-
Notifications
You must be signed in to change notification settings - Fork 65
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
Prevented default in onPointerDown does not trigger onOutsideClick #16
Comments
Pointer events don’t work in Safari or fully in IE 10, so I’m not sure it’s a good idea to use them at all yet. If there’s a way to make this library work with them, however, it’d be great to fix that. |
Good point, just changing the handler from
I can think of one solution: handle both |
Having the mouse event handlers be conditional seems like a bug farm; could instead we install both, and code it such that it both expects and handles either or both being called? |
That does sound like a safer approach. I have some code in my fork that adds handlers for The easy cases are when only
The option 2 seems like a better option though. Any thoughts? |
I’m not sure, neither of those sound great. |
I did come up with a third option: use Event.timeStamp to detect when both |
Hmm, I'll take a look at this today. It looks like using |
Repro: https://codesandbox.io/s/p9jl7jq627
Clicking on a
div
withmouseDown
default preventer triggersonOutsideClick
, while clicking on adiv
withpointerDown
default preventer does not.This is because
mouseDown
will not be fired if the default is prevented inpointerDown
, see step 6 under 7.1 in Pointer Events Specification.Is this something that this library should support? I tried switching
mouseDown
->pointerDown
andmouseUp
->pointerUp
and everything seemed to work like it should.The text was updated successfully, but these errors were encountered: