Stop specific Cell event propagation when using onRowAction #6449
Answered
by
snowystinger
lucadido06
asked this question in
Q&A
-
Hey everyone! How would you suggest stopping the event propagation from the onRowAction for a specific cell? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
snowystinger
Jul 10, 2024
Replies: 1 comment 3 replies
-
Can you say more about your use case? Maybe an example? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, for the delay. Since you're using using your own button, you'll need to stopPropagation on onPointerDown so it doesn't get to the row.
onClick
is problematic for many reasons, they're outlined in https://react-spectrum.adobe.com/blog/building-a-button-part-1.html. It would probably be easier if you could use a RAC Button, or useButton, or usePress (in order of suggested preference). These will all handle stopping the propagation and preventing defaults for you in a way that will most easily work with the rest of our interactions.