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

onClickOutside doesn't trigger on iOS #13

Closed
benoitgrelard opened this issue Aug 14, 2019 · 0 comments · Fixed by #14
Closed

onClickOutside doesn't trigger on iOS #13

benoitgrelard opened this issue Aug 14, 2019 · 0 comments · Fixed by #14

Comments

@benoitgrelard
Copy link
Contributor

Hi @theKashey,

Whilst implementing a modal dialog using react-focus-on I have realised that the onClickOutside callback doesn't get triggered on iOS (possibly all touch devices?)

I have done some investigation and I saw that the lib attaches a click handler on the document in Effect.tsx (here).

However, after some investigation, it appears iOS doesn't trigger any click events on nodes unless they "look" clickable (see this comment).

I have a fix for it (basically attaching a touchstart handler on top of the click handler).
I will send you a PR and we can continue the discussion there.

✌️

theKashey added a commit that referenced this issue Aug 14, 2019
fix: fixes onClickOutside on iOS devices. fixes #13
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 a pull request may close this issue.

1 participant