Skip to content

Is it possible to disable scrolling on touchmove event for plotly graph element? #1621

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

Closed
juni-green opened this issue Apr 26, 2017 · 1 comment

Comments

@juni-green
Copy link

Hi,
I've been trying to integrate touch support for box selection functionality in plotly.js for 2D graphs. I've mapped touchstart, touchmove, and touchend to mousedown, mousemove, and mouseup events respectively. This mapping allows selection of area on the graph, but after selection, it doesn't allow to make another selection and doesn't event trigger touchstart (that is mapped to mousedown) event, it only triggers touchmove event (that is mapped to mousemove), since touchmove enables scrolling on touch devices, so after performing selection, only touchmove events get triggered on every touch on the screen. It suspends the whole web app functionality. So I was wondering if I could disable default scrolling on touchmove then it could possibly resolve the issue. I've also tried adding e.preventDefault(); on touchmove but it gives this warning:
"Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted."

Any help will be appreciated.
Thanks!

P.S.: I've also looked into the relevant posts like 480, but couldn't find any solution for touch selection on 2D graphs.

@etpinard
Copy link
Contributor

Kinda hard to help here without a reproducible example.

In fact, this question is best for https://community.plot.ly/. Closing.

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

No branches or pull requests

2 participants