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
- fix: Autocomplete can't be focused #1744 — committed to akveo/react-native-ui-kitten by bataevvlad a year ago
- fix: Autocomplete can't be focused #1744 (#1747) — committed to akveo/react-native-ui-kitten by bataevvlad a year ago
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:
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 thePopover
containing theInput
andList
components is visible. Once there is text in theInput
that doesnât result in a match, thePopover
canât be visible again currently.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
ononShow
, but since thatâs not exposed forAutocomplete
it will require a change in UI Kitten. I did try it manually inAutocomplete.component.tsx
and it did work though.