lawnstarter / react-native-picker-select

🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
https://npmjs.com/package/react-native-picker-select
MIT License
1.74k stars 497 forks source link

Using onFocus, onBlur for Android #443

Open kadiraydinli opened 3 years ago

kadiraydinli commented 3 years ago

Hello, I cannot detect if the dialog opens and closes on Android as it is for the IOS side. For this, we can use the onFocus and onBlur props of the @react-native-picker/picker package to make the onOpen and onClose props of the package available for Android.

As an example, it can be done as follows.

<Picker
    ...
    onFocus={() => onOpen && onOpen()}
    onBlur={() => onClose && onClose()}
    ...
>
    ...
</Picker>

If you want, I can fork and open a PR for the changes I made.

osvaldokalvaitir commented 3 years ago

I'm also not able to pass the focus to the component to open on Android

PavelTishenko commented 2 years ago

How about pickerProps: {{onFocus: handleOpen, onBlur: handleClose}} ?