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
Improve quick release by requiring some cursor movement (#3762)
This PR improves the quick release feature we have for Menu, Listbox and
Combobox components. This now ensures that your mouse was moved at least
`5px` before triggering the quick release action.
This odd behavior is most prevalent in Listbox components where the
`anchor="selection"` feature is used such that the options are rendered
on top of the Listbox button. Because of this, if you hold your cursor a
bit too long when clicking the Listbox it would immediately select the
option and close again.
With this improvement in place, you have to at least move your cursor
`5px`. This is an arbitrary value I picked so we can tweak it if we
wanted to, but `1px` to `3px` felt too small and `10px` felt too large.
### Test plan
When initially opening the Listbox, I'm holding down my cursor a bit
(but not moving!) and then releasing the "click".
#### Before:
Notice how the initial click results in the Listbox closing again once I
release the cursor.
https://github.com/user-attachments/assets/df8dc749-ce20-46c9-8815-ac817b789b7e
#### After:
Notice how the initial click results in the Listbox staying open even
after releasing the cursor. This is because we didn't move enough so we
don't register it as a quick release.
https://github.com/user-attachments/assets/f8d76a7b-1edd-4d9a-a8d3-120aadf49c57
0 commit comments