Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useAnimatedReaction works globally and tries to focus on <TextInput /> of the GiftedChat when we open keyboard for each other <TextInput /> #2572

Closed
danilvalov opened this issue Dec 23, 2024 · 1 comment

Comments

@danilvalov
Copy link
Contributor

danilvalov commented Dec 23, 2024

Issue Description

Very interesting bug with useAnimatedReaction hook.

This hook works globally for keyboard on all screens, so if GiftedChat was rendered and we keep it in memory then any keyboard opening calls handleTextInputFocusWhenKeyboardShow callback that tries to focus on GiftedChat TextInput. And it breaks all TextInputs in apps.

Steps to Reproduce / Code Snippets

  1. (optional) Use @react-navigation in your app (with setting to keep rendered screens in app memory)
  2. Add <GiftedChat /> to the second screen of your app
  3. Add some another <TextInput /> to the first screen of your app
  4. Open your app and focus on your <TextInput /> on the first screen
  5. Touch some place out of the this text input (it works correctly, keyboard is hide)
  6. Open the second screen with GiftedChat (to render this component first time)
  7. Open the first screen with <TextInput /> again
  8. Touch some place out of the this text input (it works incorrect alreadt, keyboard is show anyway)

Expected Results

Keyboard is hide on the last step when we tap out of the our <TextInput />

Additional Information

  • Nodejs version: 18
  • React version: 18.3.1
  • React Native version: 0.75.4
  • react-native-gifted-chat version: 2.6.4
  • Platform(s) (iOS, Android, or both?): both
  • TypeScript version: 5.0.4
@danilvalov
Copy link
Contributor Author

Sorry, duplicate of the #2548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant