Replies: 2 comments 4 replies
-
Hey! It might be a good idea to address the menu rendering over the picker button. What are you using to do the positioning? Selecting on Press start instead of end may lead to some accidental selections. (I'm quite clumsy with my thumb on a mobile device) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply @snowystinger. We are currently using |
Beta Was this translation helpful? Give feedback.
-
Hi all,
Have there been any discussion around using
setPointerCapture
for the custom PressEvents?We have a use case in which a Select Field is used within a Modal. The Modal and the Select Field's menu use an OverlayContainer for positioning. We set
shouldSelectOnPressUp: false,
in ouruseOption
hook because we've noticed sometimes the menu can load on top of the SelectField (if the viewport is short enough), which would cause an immediate selection of the option if not set.Example of the layout I am describing:
When a user selects an option that is outside of the Modal's contents (on top of the 'underlay') such as option "Employee 6" in the above example, then the
onPointerDown
event selects the option (due toshouldSelectOnPressUp: false
). That event immediately removes the menu and the subsequentonPointerUp
event is triggered on the Modal's underlay, which causes the Modal to close. I have been trying to figure out a way around this, such as usingshouldCloseOnInteractOutside
in the Modal'suseOverlay
hook, but that only gives me access to the element the Press event is triggered on without a way of figuring out where the pointer event originated from.The two issues I described (1. Having to use
shouldSelectOnPressUp: false
to avoid accidentally selecting menu option if menu is displayed on top of trigger, and 2. The subsequent onPointerUp triggering on the underlay) could possibly be mitigated by usingsetPointerCapture
in the onPointerDown event. Any thoughts?Beta Was this translation helpful? Give feedback.
All reactions