react-native-autocomplete-input icon indicating copy to clipboard operation
react-native-autocomplete-input copied to clipboard

Focus problem

Open brkcnaka opened this issue 1 year ago • 4 comments

The version I was currently using in my project was v5.4.0. With the last update, I switched to v5.5.5. However, in this version, I could not focus on the input I rendered with renderTextInput. I've only tried it on iOS, I don't know what the situation is on Android.

I fixed the problem by downgrading back to v5.4.0.

"react-native": "0.73.6" "expo": "50.0.20"

brkcnaka avatar Jan 07 '25 13:01 brkcnaka

Same problem here

thomasviaud avatar Jan 07 '25 14:01 thomasviaud

I've managed to fix this by wrapping the render function in a useCallback hook:

  const renderTextInput = React.useCallback((props: TextInputProps) => <YourCustomInput {...props} />, [])

and then:

<Autocomplete
        ...
        renderTextInput={renderTextInput}
        ...
/>

thomasviaud avatar Jan 07 '25 14:01 thomasviaud

we are also experiencing this, any time the renderTextInput prop changes focus is lost, which can be awkward to work around if there's a reason the text input style may change while the user is editing the text (e.g. form validation).

garobrik avatar Jan 15 '25 21:01 garobrik

This should be fixed with in v5.5.6

mrlaessig avatar Jan 24 '25 22:01 mrlaessig

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 27 '25 08:10 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Nov 03 '25 08:11 github-actions[bot]