Why does clicking ListBoxItems that have href not fire a click event #6487
Replies: 1 comment
-
We do a bunch of interaction normalization in our components https://react-spectrum.adobe.com/blog/building-a-button-part-1.html As a result, if you're following that gist and we had left the click to fire, you'd get events for the ListBox, but not navigation for the Table. We handle everything that gist would be handling for you in Collections, so it's better to follow the guides at https://react-spectrum.adobe.com/react-aria/routing.html#remix to set up your routing. Let us know if that isn't fulfilling your needs. |
Beta Was this translation helpful? Give feedback.
-
Hello! My team and I have been using the React Aria Components library as the base for our common UI components; we really like it and appreciate all the effort put into it.
The question we have is: why does clicking on a ListBoxItem that has an
href
prop not fire a click event? Or is the click being suppressed for some reason? The reason why we are interested in this is because we have some event delegation set up (actually inspired by this) to power some business logic.In case it helps, I've put together an example where the behavior mentioned above can be reproduced. Couple of notes:
react-aria-components
to enable client side routing.href
, but not when it is a relative path.click
events aren't captured by theonEvent
handler,pointerup
events are, which is what we have opted to do in the meantime. The issue with usingpointerup
is that keyboard presses aren't captured that way.Beta Was this translation helpful? Give feedback.
All reactions