Skip to content
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

Fix: Allow proper cancellation of default browser actions on iOS #503

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pbakaus
Copy link

@pbakaus pbakaus commented Feb 22, 2023

This deceptively small commit fixes an issue that most likely have been introduced by the Firefox fix (see line 122).

Current behavior:
On iOS, scroll (at least inside iframes) isn't getting cancelled because the touchmove is a passive listener. Calling e.preventDefault() in line 145 doesn't actually do anything.

New behavior
Adding passive: false makes the listener active, and everything works as intended (scroll is stopped when drag starts). Weirdly enough, the comment in line 120 already suggests this is being done, but...it wasn't 😅

@vercel
Copy link

vercel bot commented Feb 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
dnd ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 2, 2023 at 0:36AM (UTC)

@Xhale1
Copy link
Collaborator

Xhale1 commented Mar 2, 2023

Hello hello! Thanks for the PR! Apologies for not getting to this sooner.

I might be misunderstanding the change here, I'm not seeing a change on iOS using the storybook link. When I drag on iOS 16.3.1 the page continues to scroll with the touch movement.

Note that you can test dnd without the iframe using this link and scrolling appears to work as intended.

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

Successfully merging this pull request may close these issues.

2 participants