Closed kilbot closed 2 days ago
As a temporary workaround, you can trigger the select to open with its ref. You can use this as a reference: https://github.com/mrzachnugent/react-native-reusables-nextjs-demo/blob/main/src/components/ui/select.tsx#L35
Thanks. Explicitly calling the trigger open in onPress
seems to work fine.
This issue only effects the Select trigger (ie: the Popover trigger works fine). Reading through the developer comments in the Radix UI select component, it seems that they have a reason for preventing touch, so I think this is fine solution for those that need to support mobile browsers.
Thanks for your work on react-native-reusables
, it's helped me greatly when transitioning my old component library from styled-components
to nativewind
.
Describe the bug SelectTrigger does not work when using on a mobile web browser
To Reproduce Steps to reproduce the behavior:
Expected behavior SelectTrigger should work on mobile browsers.
Screenshots
Platform (please complete the following information):
Additional context This is not a problem with the
react-native-reusables
reusables library itself. The issue is due to this line of code in Radix UI. The event.pointerType is 'touch' and so thehandleOpen
is never triggered. The Radix UI Select demo does work on mobile browsers, so I suspect this has something to do with the wayreact-native-web
handles Pressable events.Perhaps it we need to handle
onPointerDown
events ourselves to make it compatible with Radix UI?