maxkordiyak / react-native-dropdown-autocomplete

Autocomplete input with dropdown modal component for React native. Useful for pages with multiple autocomplete's.
MIT License
100 stars 51 forks source link

Input loses focus after dropdown appears #4

Closed Xyzor closed 5 years ago

Xyzor commented 5 years ago

Currently after search, it shows the result list, but loses the focus on the input.

Is there a solution to focus the selected input after search or to pass down a ref prop?

maxkordiyak commented 5 years ago

it is not possible as long as result list is a modal. you can't interact with input because it is outside modal

UdyogaG commented 5 years ago

there is have any way to keep open the keyboard without hiding the keyboard.

PaitoAnderson commented 5 years ago

Reopening for further discussion as it's a pretty serious drawback for this library.

PaitoAnderson commented 5 years ago

Took a look at this briefly, and came too a few conclusions...

In order to solve this we probably need to take one of these approaches...

1) Expand the <Autocomplete /> component when showing the dropdown pushing anything below it down instead of trying to overlap it, looks less cool but resolves a significant issue imo. 2) Perhaps do something with native code which would add significant complexity to this library.

PaitoAnderson commented 5 years ago

Created a PR for expanding the component, only minor issue is if you use this component in a ScrollView/FlatList be sure to set keyboardShouldPersistTaps="always" so you can tap on the results when the keyboard is still visible.