Skip to content

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

Closed
@juni-green

Description

@juni-green

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions