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

Improve close logic for backdrop #63

Merged
merged 1 commit into from
Oct 16, 2018

Conversation

JordanSjodinFaithlife
Copy link
Contributor

@JordanSjodinFaithlife JordanSjodinFaithlife commented Oct 9, 2018

If you were to: mouseDown in a child, followed by dragging your mouse out of the child and a mouseUp in the background, you would receive an onClick and the target would be the backdrop. Then the current code would close the modal. This is not good when dragging a scrollbar as it is very easy to be dragging with the mouse down and release within the backdrop, causing accidentally closing.

This also effects touchEvents too. Replace what was said above with touchStart/End instead of mouseDown/Up

old message
Using onClick, a mouseDown in a child , then dragging your mouse, and a mouseUp in the background causes onClick to be called, and the target is the backdrop, thus it closes. This is no good when dragging a scrollbar as it is very easy to be dragging with the mouse down and then release while over the backdrop.

@dustinsoftware
Copy link
Contributor

This change breaks closing the modal on iOS..

@JordanSjodinFaithlife
Copy link
Contributor Author

@dustinsoftware thats unfortunate. So iOS gets the onClick but not the mouseDown/ups? Think there are touchDown🏈/Ups that I could use?

Currently it is pretty easy to close the modals on accident..

If you were to: mouseDown in a child, followed by dragging your mouse out of the child and a mouseUp in the background, you would receive an onClick and the target would be the backdrop. Then the current code would close the backdrop. This is not good when dragging a scrollbar as it is very easy to be dragging with the mouse down and release within the backdrop, causing accidentally closing.

This also effects touchEvents too. Replace what was said above with touchStart/End instead of mouseDown/Up
@JordanSjodinFaithlife
Copy link
Contributor Author

@dustinsoftware updated, and tested on a real iPhone.

@dustinsoftware dustinsoftware merged commit fba7900 into Faithlife:master Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants