-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
DragElement: initialize clientX and clientY for touch events #2997
Conversation
this sets clientX and clientY to the values from the first touch in TouchEvent.changedTouches
Thanks very much for this PR @jonfunkhouser ! It's probably the least-bad way to fix the regressions introduced in #1804. If I understand correctly, At some point, we'll probably need another attribute (e.g. Now, @jonfunkhouser have you checked that all the features added in #1804 still work on your branch? |
It ends up emitting
The above I'm just now starting to validate the features in #1804, I'll reply again when that's complete. |
Thanks very much ! |
I just pushed three sample scatter charts here: https://jonfunkhouser.github.io/plotly-mobile/ The first chart demonstrates default behavior, including |
@jonfunkhouser I was able to test your patch on my Android phone. I must say: this is a wonderful PR. I confirm that touching on points triggers the Now, there's still no way to "hover" when Applying your patch on-top of the latest master (to include click-to-select from #2944) and setting In brief, this PR:
It would be nice to lock the touch hover behavior down so that regression like #1967 don't happen again. We do have few touch tests, for example this one that tests selections: plotly.js/test/jasmine/tests/select_test.js Lines 1052 to 1085 in 5fa493a
@jonfunkhouser Would you be interesting in adding a touch hover test somewhere |
Thanks for adding that test @jonfunkhouser !!! I pushed a small commit to fix up I'll now merge this PR and release it as part of 1.41.1 |
Fixes #1967
Fx.hover() uses evt.clientX and evt.clientY to calculate an offset for the hover. In a TouchEvent, these properties are undefined, which results in the hover being rejected.
https://github.com/plotly/plotly.js/blob/master/src/components/fx/hover.js#L285