react-native-gifted-chat
react-native-gifted-chat copied to clipboard
Message not scroll smoothly when Keyboard open and close
Issue Description
when keyboard open messages did not goes smoothly with keyboard rather take time .
Expected Results
Should move smoothly when keyboard open or close
Additional Information
- React version: [17.0.2]
- React Native version: [0.67.3]
- react-native-gifted-chat version: [(https://github.com/FaridSafi/react-native-gifted-chat)]
- Platform(s) (iOS, Android, or both?): [Android]
Same here
just build in release mode
i tested in release mode, still problem with android, ios work good
same here
I tested with m1 mac simulator,build in release mode, and the layout took about ~500-800 milliseconds to resize after keyboard showed
I tested with m1 mac simulator,build in release mode, and the layout took about ~500-800 milliseconds to resize after keyboard showed
What should we do?
i see the log of metro and I see the screen re-render 4 times when keyboard show, i think better we need to use wix keyboard input
test the demo with android simulator( not m1), it's took delay when press to show keyboard first time, but very smooth animation
Any solutions?
any solution gaesss?? i search everywhere for days but i dont find any solution
@hotaryuzaki unfortunately, I also did not find solutions to this problem, so I had to abandon the use of this library, but it did not turn out to be a big problem, since all the components were already custom (text, images, time, send/read tick marks, etc.). So I just use FlatList and it works fine
@hotaryuzaki unfortunately, I also did not find solutions to this problem, so I had to abandon the use of this library, but it did not turn out to be a big problem, since all the components were already custom (text, images, time, send/read tick marks, etc.). So I just use FlatList and it works fine
Yes maybe it is better to create the UI by ourselves.
I tried tricky fix with keyboard event but sadly android didn't have keyboardWillShow and keyboardWillHide. I think we can use keyboardWillHide to change windowSoftInputMode to adjustPan. But for temporary solution I create animation using scheduleLayoutAnimation in keyboardDidHide, it feels more convenient.
For more investigation, what I found this problem just occurred in Android 10 and below. Maybe it's android limitation I create temporary solution only for that versions.
And maybe next week I will create touch/scroll event outside the keyboard, for this I think I can set windowSoftInputMode to adjustPan then hide the keyboard by using keyboard.dismiss(). (I made backhandler event to do this trick but the event didn't called when keyboard is open)
Any solutions? :(
the solution is useAnimatedKeyboard
@fukemy Could you be more specific?
i just used reanimated for smooth animation. but flatlist reload everytime when scroll and it make performance problem
@BuqiLiao just take a look here: https://docs.swmansion.com/react-native-reanimated/docs/2.x/api/hooks/useAnimatedKeyboard/
big issue for me too.
Hi
Please try my PR
https://github.com/FaridSafi/react-native-gifted-chat/pull/2493
"react-native-gifted-chat": "kesha-antonov/react-native-gifted-chat#43625da0ae36d983c339c0d79ae900c8778f5241"