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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Have there been any discussion around using
setPointerCapturefor 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 ouruseOptionhook 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
onPointerDownevent selects the option (due toshouldSelectOnPressUp: false). That event immediately removes the menu and the subsequentonPointerUpevent 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 usingshouldCloseOnInteractOutsidein the Modal'suseOverlayhook, 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: falseto 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 usingsetPointerCapturein the onPointerDown event. Any thoughts?Beta Was this translation helpful? Give feedback.
All reactions