drei icon indicating copy to clipboard operation
drei copied to clipboard

presentationcontrols has unexpected behavior on mobile device

Open Andy-Leo opened this issue 3 years ago • 6 comments

Presentationcontrols can do well in PC device, but not work as expected when i toggle device to mobile. Is this a compatibility issues or what i missing?

https://drei.pmnd.rs/?path=/story/controls-presentationcontrols--presentation-control-story

Andy-Leo avatar Oct 25 '22 17:10 Andy-Leo

Also seeing this too. Did you manage to find a solution @Andy-Leo ?

marklundin avatar Nov 28 '22 19:11 marklundin

Just for future reference. It seems that setting the touch-action on the dom element that captures the drag will fix this

marklundin avatar Nov 29 '22 14:11 marklundin

If you're wondering how to do this correctly like I was, I just set a CSS property for all canvases in a global CSS file like below and it solved my problem.

canvas {
    touch-action: none;
}

bawolf avatar May 12 '23 06:05 bawolf

Thanks bawolf. ChaptGPT could not solve the problem 4 me. HumanIntelligence ftw

AmbiguousX avatar Aug 14 '23 16:08 AmbiguousX

canvas {
    touch-action: none;
}

works for the issue in itself. But then scroll no longer works on page (when trying to scroll the page in the canvas). Anyone that has a solution that can fix both parts? That would be great :)

fully-john avatar Apr 29 '24 11:04 fully-john

canvas {
    touch-action: none;
}

works for the issue in itself. But then scroll no longer works on page (when trying to scroll the page in the canvas). Anyone that has a solution that can fix both parts? That would be great :)

Yes! I'm also struggling to get PresentationControls working properly on a scrollable mobile page. For now my solution is make the canvas 80% of the screen width - so that the user can easily grab the edges to scroll down.

whoiskevintho avatar May 10 '24 02:05 whoiskevintho