Open olegcherr opened 2 years ago
Can you replicate the issue on this URL? https://5fc05e08a4a65d0021ae0bf2-unebtvimdp.chromatic.com/iframe.html?id=presets-sortable-vertical--press-delay&viewMode=story
I did not reproduce this with Press Delay
, but the same problem occurs with the following two.
The problem occurs on chrome for android because of the redesigned long-press context menu since chrome 78.
An easy fix is to use user-select: none;
a.k.a userSelect: 'none',
in your container style.
Thank you @Knaackee , had the same problem for a while. Unfortunately, the container for me is not enough since I have elements that are close to others and being precise would require another context or props drilling to set another upper state to apply the class (since the text should be selectable while not dragging).
I have solved with pure JS/CSS:
body.is-dragging {
* {
user-select: none;
}
}
// Apply to any DnD context
<DnDContext
onDragStart={() => document.body.classList.add('is-dragging')}
onDragEnd={() => document.body.classList.remove('is-dragging')}
>
Wondering if it can be something we can control via DnD context prop in the library?
This doesn't work in Chrome on Android: https://5fc05e08a4a65d0021ae0bf2-unebtvimdp.chromatic.com/?path=/story/presets-sortable-vertical--press-delay
https://user-images.githubusercontent.com/3730074/148017262-96c212fe-5780-4fc3-8f2c-40ce8447966a.mp4