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
If you click inside a Dialog or SideSheet component, drag your mouse outside of the element to the overlay, and release the mouse, the dialog / sidesheet dismisses.
Of course, these onClick events will fire for any click inside the overlay (including inside the children, e.g. Dialog/SideSheet) which is undesirable. So the handleBackdropClick handler checks that the currentTarget (the element where the handler is registered) is the same as the target (the element that fired the onClick event)
This ensures that clicks inside of the children do not close the overlay. However, there is a problem with this approach: onClick is only fired for mousedown+mouseup where both events fire in the same element. But since Box encompasses both the backdrop and the children (e.g. SideSheet/Dialog), any click inside any part of the overlay will result in an onClick event.
So I think what we're seeing is that some browsers (Chrome) use the mouseup element as the target, thus defeating the check target === currentTarget in cases where the mouseup is on the backdrop, even if the mousedown is in the children.
If you click inside a Dialog or SideSheet component, drag your mouse outside of the element to the overlay, and release the mouse, the dialog / sidesheet dismisses.
Steps to repro:
I'd expect the dialog not to respond to the dismissal because the click didn't start on the overlay.
The text was updated successfully, but these errors were encountered: