react-native-ui-kitten: Autocomplete can't be focused

🐛 Bug Report

To Reproduce

Steps to reproduce the behavior: Try using the autocomplete async showcase from the docs: https://akveo.github.io/react-native-ui-kitten/docs/assets/playground-build/#/AutocompleteAsync

I first had the issue on my local project and tried to investigate what is happening. It seems to happen when there is no <AutocompleteItem/> to <Autocomplete/> element (this should be handled as it may happen when the input text doesn’t match any of the results).

Expected behavior

When clicking on the input, it should become focused, and I should be able to enter my text. However, the input doesn’t focus and I can’t enter anything.

I first had the issue on my local project and tried to investigate what is happening. It seems to happen when there is no <AutocompleteItem/> children to <Autocomplete/> element.

Link to runnable example or repository (highly encouraged)

https://akveo.github.io/react-native-ui-kitten/docs/assets/playground-build/#/AutocompleteAsync

UI Kitten and Eva version

Package Version
@eva-design/eva
@ui-kitten/components 5.3.1

Environment information


About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 17 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks @Codelica for sharing the snippet., however this didn’t work for me. I had to use another lib for this. 😦

What’s the current status of this bug? This is a showstopper for us now 😦 . @Codelica or anyone else do you mind sharing your code snippet? Don’t mind it’s a hack just want to tide over the issue for now.

Can someone give me a status update on this bug? Any time indication for the fix? If it takes to long to fix I’ll need to find another solution.

It seems there are a couple bugs involved here with Autocomplete:

  1. Regarding not being able to focus/edit the Autocomplete field again once it has some text entered which doesn’t result in any item matches, that involves this.state.listVisible being used to determine if the Popover containing the Input and List components is visible. Once there is text in the Input that doesn’t result in a match, the Popover can’t be visible again currently.

  2. Regarding the keyboard not coming up on Android when Autocomplete is initially focused (without a 2nd tap), that seems to be an issue with RN’s Modal – which UI Kitten uses now. There is a workaround here using a setTimeout on onShow, but since that’s not exposed for Autocomplete it will require a change in UI Kitten. I did try it manually in Autocomplete.component.tsx and it did work though.