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 modal from closing when modal is partial target of click #30

Merged
merged 1 commit into from
Aug 21, 2019

Conversation

1000hz
Copy link
Contributor

@1000hz 1000hz commented Aug 21, 2019

When the user starts a click on the modal and ends it elsewhere (or vice versa) the modal is not prevented from closing. This is not a great experience, since the user might be trying to select text inside of an input or accidentally started their click outside the modal and doesn't intend to actually close it.

This PR prevents the modal from closing if the modal is the target of either the mousedown or mouseup phase of the click.

Fixes #29

@1000hz 1000hz force-pushed the fix-modal-close-behavior branch from 54ae531 to e45e44b Compare August 21, 2019 15:17
@manatarms manatarms self-requested a review August 21, 2019 15:20
@nickbalestra nickbalestra self-requested a review August 21, 2019 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modal closes on partial click
3 participants