You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In macOS/Safari >= 13, if a number input has the useDrag handlers attached a single click on the input spinner buttons makes any cursor movement over the arrows trigger what appears to be the UA provided increment/decrement mechanism. After that there seems to be no way to have it cease whether the input is focused or not.
This originates from: WordPress/gutenberg#32497. From what I can tell this could end up being a Safari bug, though I was unable to reproduce it with addEventListener and noop handlers for the same events pointer(up|down|move|cancel).
Additional Related Issue/Video
In Chromium 90, I found that sometimes a drag does not stop when it ends outside of the input. It seems to be only when there is a text selection active simultaneously so it's not always easy to trigger. The response to cursor movement outside the input does end, but it continues to respond to cursor movement inside the input and the dragging state is still true.
@stokesman sorry for the late answer. I think it's indeed a Safari bug, but you can get away with it by not using capture, and add the following option to your handler config:
Thanks so much @dbismut! I can't reproduce either issue with pointer: { capture: false }. Great to see such a simple solution.
It's curious to me because the handlers from bind() don't look like capturing ones (onPointerDown as opposed to onPointerDownCapture). I guess there are some other window/document listeners added that the capture option applies to.
Describe the bug
In macOS/Safari >= 13, if a number input has the useDrag handlers attached a single click on the input spinner buttons makes any cursor movement over the arrows trigger what appears to be the UA provided increment/decrement mechanism. After that there seems to be no way to have it cease whether the input is focused or not.
This originates from: WordPress/gutenberg#32497. From what I can tell this could end up being a Safari bug, though I was unable to reproduce it with
addEventListener
and noop handlers for the same eventspointer(up|down|move|cancel)
.Sandbox
https://codesandbox.io/s/draggable-number-dvqi6?file=/src/index.js
Video
use-drag-number-input-safari14.mp4
Additional Related Issue/Video
In Chromium 90, I found that sometimes a drag does not stop when it ends outside of the input. It seems to be only when there is a text selection active simultaneously so it's not always easy to trigger. The response to cursor movement outside the input does end, but it continues to respond to cursor movement inside the input and the
dragging
state is stilltrue
.use-drag-number-input-chromium90.mp4
Information:
Checklist:
touch-action: none
to the draggable element.The text was updated successfully, but these errors were encountered: