Skip to content

draggable element isnt working on touchscreen #204

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

Open
junenoshita opened this issue Apr 11, 2025 · 2 comments
Open

draggable element isnt working on touchscreen #204

junenoshita opened this issue Apr 11, 2025 · 2 comments

Comments

@junenoshita
Copy link

It was described as touch device compatible, but the draggable components stopped working when i used devtools to simulate mobile device, there was no documentation to adapt the code for mobile devices so i assumed it didnt need alterations for it to work. I tried on others browser and devices and none of them worked the touch to drag the component. Could someone help?

@rohanajayjain
Copy link

From testing on the Pragmatic Drag and Drop docs website, it doesn't seem to work on Firefox on Android (137.0) but works on Chrome on Android for me. I have to long press in Chrome on Android for drag and drop to work, it seems slightly clunky and can't tell if that's intended behaviour.

I also can't drag and drop using touch simulation in dev tools on Firefox or Chrome on desktop.

@TheRealFlyingCoder
Copy link

TheRealFlyingCoder commented Apr 13, 2025

Confirming touch does not seem to work with my simple implementation on mobile.

Even with a long hold and adding onContextMenu={e => e.preventDefault()} to stop the context menu popping up none of my draggable elements are draggable on touchscreen,

Tested both Chrome on Android and Chrome DevTools

Weird thing is the Docs work for me but I agree with @rohanajayjain that the touch delay is the full long-press which just doesn't work ideally for my scenario of wanting instant dragging on mobile and desktop

I am using RR7+React19 so not sure whether that could be the culprit, i'm also disabling the native drag preview:

			onGenerateDragPreview({ nativeSetDragImage }) {
				disableNativeDragPreview({ nativeSetDragImage });
			},

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

3 participants