Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent clicks originating inside modal from dismissing #36603

Closed
wants to merge 1 commit into from

Commits on Jun 19, 2022

  1. Prevent clicks originating inside modal from dismissing

    Current behaviour means any click events on the modal backdrop will dismiss the dialog, regardless of whether the initial mousedown event originated inside the dialog. When the modal contains elements such as text inputs, it's quite easy to accidentally close it by (for example) clicking and dragging to select text; if the mouse is released over the backdrop, the modal will close.
    
    This change uses an event handler for mousedown and mouseup, and tracks whether a mousedown began outside the dialog or not.
    Sentox6 committed Jun 19, 2022
    Copy the full SHA
    303ffeb View commit details
    Browse the repository at this point in the history