-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
KeyboardAwareScrollView freezes another animation on the screen when opening the keyboard #750
Comments
@denysoleksiienko is it iOS only? Android works well? |
Have you tried to animate it as I suspect that this code: const progress = useDerivedValue(() =>
withTiming(fontColorAnimated.value, { duration: animationDuration }),
); Can be triggered every time when keyboard changes its frame, and you restart animation every time (it's only assumption). |
It looks like the problem is in the react-native-reanimated version. I will test more |
I updated react-native-reanimated to the latest version 3.16.6 and it seems to help in my case with animated input labels, but KeyboardAwareScrollView is not smooth scrolling when the keyboard is opening on ios/android |
Can you post a video, please? In my example project it's pretty smooth: Simulator.Screen.Recording.-.iPhone.15.Pro.-.2025-01-07.at.13.23.34.mp4 |
Finally tracked this issue to this dependency. I even noticed that using KeyboardAvoidingView at some point will mess up my animations for my react navigation Drawer Nav and eventually crash the app. Seems to mess up almost all of my animations related to react-native-reanimation. I'm pretty sure its linked ot this warning as well [Reanimated] Tried to modify key |
@denysoleksiienko were you able to figure out anything else related to this issue? |
@CaptainJeff
So it works exactly the same as in the video from the first message with freezes. However, regarding the new version RN + Reanimated, it’s hard for me to determine whether the issue is with our optimization or if there’s something wrong with Reanimated or another library. But after upgrading RN to 0.76.x and Reanimated to 3.16.x all my animations working with freezes which works on 0.75 and 3.15 well.
I noticed that if we use animations at the bottom root, they are smoother, but if we navigate to another navigator and go to the 3rd or 4th screen (where our form is located), the animations become less smooth. It’s difficult to figure out, because we’re using the nx monorepo.
PS: |
@denysoleksiienko interesting. Thanks for the update! I realized like 30 minutes ago that my issue is probably something different. Once any invocation of react-native-keyboard-controller was displayed nearly all subsequent reanimation attempts would lag and eventually crash my app. Even stuff like togglign the react navigation drawer. But mine was caused by having "animation: none" on a parent Navigator (react navigation). Once i removed that I fixed the crashing and most of the animation issues. I'm still getting some lag but I don't think thats related to this library anymore. I suspect your issue is different but wanted to share that incase anyone else comes across it |
@denysoleksiienko maybe you can prepare a demo with nested screens? If it's reproducible in isolated project then I can help to debug the problem 😊 |
@denysoleksiienko sorry. I was just wanted to clarify something. I was wrong when I said it was only the animation styles causing my issue. That fixed a different issue I was having with react reanimation. My initial assertion was correct. This library caused reanimation issues. IE When i used Seems like its related to this error |
@CaptainJeff may I kindly ask you to provide a minimal reproduction example?
I strongly believe it has been fixed in #662 Which |
@kirillzyusko It seems like when I remove the AnimatedText label the scrolling becomes smoother but it doesn't look enough. I will try to prepare this screen from my project |
Awesome, thank you ❤ |
@kirillzyusko Hello! Here, I quickly made a user form screen that has lags and freezes, although, on the previous version of react-native-reanimated 3.15.1, it works normally. I thought this was a problem with our nx workspace, but it's reproducible on the clean project For some reason, the collapsible card and bottom sheet are freezes/lags. Additionally, when using KeyboardAwareScrollView, there are some lags at the end scroll. I also noticed that if the last focus was on the last promo input, and then you scroll up the screen and switch between full and child ButtonGroup or expand the collapsible data, the scroll jumps to the end. Please help
|
@denysoleksiienko okay, checking it now 👀 |
@kirillzyusko any update? 🙂 |
Freezes and issues in Reanimated 3.16.x in New Arch |
@denysoleksiienko may I kindly ask you to send here a link to the issue in the reanimated repository? 👀 |
Describe the bug
I am using an input with a floating label implemented with react-native-reanimated. When I use the native ScrollView, the animations remain smooth when the keyboard opens. However, when I use KeyboardAwareScrollView, my labels sometimes experience delays. I will add the code for my input and a video demonstrating the different behaviors. Also works well with KeyboardAvoidingView.
Code snippet
Expected behavior
Keyboard in KeyboardAwareScrollView shouldn't freeze another animation on the screens
Screenshots
KeyboardAwareScrollView
Screen.Recording.2025-01-02.at.18.21.32.mov
Native ScrollView
Screen.Recording.2025-01-02.at.18.22.06.mov
Smartphone (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: