You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens with DialogContent.onInteractOutside() as well.
In my case, I have a table cell containing <DialogTrigger /> and the table row containing that cell also has its own onClick() handler.
If I make my <DialogTrigger /> in the cell to stop propagate the click event, only the dialog opens without triggering the click handler on the table row, which is a desired behavior. However, when I close the dialog via onInteractOutside(), the click event that's supposed to be stopped suddenly propagates upwards, triggering the row click handler, just like what @rjray reported.
I've found a workaround by encapsulating the whole dialog tree inside a wrapper (say a <div>) and add onclick handler on that div that doesn't do anything but calling e.stopPropagation(). So for example:
Bug report
Current Behavior
The close button/icon will propagate the
click
event up the tree of elements, triggering any otheronClick
handlers along the way.Expected behavior
I would expect that either the propagation is stopped at the button, or that there is a means of preventing the propagation.
Suggested solution
Either prevent the propagation entirely in the
onClick
, or expose something that controls whether the event propagates.Your environment
The text was updated successfully, but these errors were encountered: