react-native-select-input-ios icon indicating copy to clipboard operation
react-native-select-input-ios copied to clipboard

Using .focus() doesn't work on Android

Open FRizzonelli opened this issue 7 years ago • 3 comments

Hello! Component is great and really useful, many thanks for this :)

I'm trying to using .focus() method (with the ref) but on Android is not automatically opening the dialog/dropdown (tried with both modes). How can I open the dialog programmatically?

I need this because I'd like to automatically open the select after pressing next while I'm on a previous TextInput in my form alike view.

On iOS .focus works correctly (opens the keyboard). Can I open the dialog/dropdown on Android too?

Thank you sir!

FRizzonelli avatar Apr 17 '18 15:04 FRizzonelli

Hi, thanks for noticing. You're right about the fact that it's only working on iOS at the moment (see AbstractSelectInput.js). I'm not sure if auto focussing will really feel native on Android.

I guess we can make this work, I'll take a look at this, but feel free to make a Pull Request!

markuswind avatar Apr 17 '18 18:04 markuswind

I've looked around and find out that unfortunately this is currently not supported by RN itself.. https://github.com/facebook/react-native/issues/7817 Any idea of how we could trigger the "click" programmatically?

FRizzonelli avatar Apr 20 '18 08:04 FRizzonelli

THIS IS HUGE for me and I would love to know how to make this work. I am trying here for hours but I couldn't. There's no way to simulate a press.

djalmaaraujo avatar Apr 21 '18 22:04 djalmaaraujo