Skip to content

Initial drag on elements in touch mode leads to scrolling of the complete webpage #1132

Open
@KilamMalik42

Description

When a draggable element is touched and moved for the first time, then the webpage also scrolls. Of course it happens only if the website can scroll, e.g. the page is larger than the visible area.

I can reproduce it with the code below in the ZIP in Chrome. On Desktop you just turn on the mobile emulator in the dev console. I have created a pretty high div so the webpage itself is higher than the visible area. Now click on the blue or red item and drag it vertically -> The page will also scroll. If you drop it and then drag the same item again, it will not scroll. But if you switch to the next item it will scroll again.

Is there anything I can do better in the code? This is just a small test, copied from some codepen, but I got the same problem in a real project which is too large to post here.

drag-raph.zip

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions