When typing a value that is processed async the results do not populate until a user clicks in the box again.
Steps to reproduce the behavior:
It is currently broken in the showcase
Results should appear as soon as text is typed.
| Package | Version |
| ----------- | ----------- |
| @eva-design/eva | |
| @ui-kitten/components | v5.0.0 |
@fzf thanks for reporting. I faced the same in the project I'm currently working on.
You may try using the workaround below if you use function components:
// TODO: UI Kitten issue.
// Not updates data list visibility, if initially focused with wrong value.
React.useEffect(() => {
const shouldBecomeVisible = (autocompleteRef.current?.isFocused() || false) && (data?.length || 0) > 0;
if (autocompleteRef.current?.state.listVisible !== shouldBecomeVisible) {
autocompleteRef.current?.setState({ listVisible: shouldBecomeVisible });
}
}, [data?.length]);
@artyorsh thanks for the code. Looking forward to a better solution in the future.
@fzf thanks for reporting. I faced the same in the project I'm currently working on.
You may try using the workaround below if you use function components:// TODO: UI Kitten issue. // Not updates data list visibility, if initially focused with wrong value. React.useEffect(() => { const shouldBecomeVisible = (autocompleteRef.current?.isFocused() || false) && (data?.length || 0) > 0; if (autocompleteRef.current?.state.listVisible !== shouldBecomeVisible) { autocompleteRef.current?.setState({ listVisible: shouldBecomeVisible }); } }, [data?.length]);
how to use it? Can you show code ex? please?
@Rizayev https://snack.expo.io/elAoHThIT
Most helpful comment
how to use it? Can you show code ex? please?