software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.88k stars 1.3k forks source link

useAnimatedKeyboard frame delay results in choppy animation (iOS) #4431

Closed azcarraga closed 1 week ago

azcarraga commented 1 year ago

Description

When using the keyboard height from useAnimatedKeyboard to animate another component, there is a frame delay that results in a laggy animation. At full speed, it looks like the animated component is delayed. With slow animations enabled on the sim, you can see the choppiness/jitter (video below). I've included a min repro snack as well that demonstrates the issue on device.

https://user-images.githubusercontent.com/47671189/236428820-7b16d440-080b-4837-885d-ef1e6f0274e8.mov

Steps to reproduce

  1. Open linked snack on device (iOS) and toggle the keyboard several times by tapping the text input / tapping "return"
  2. Observe the pink bar that tracks the keyboard - you can see how it lags in both directions instead of following the keyboard frame for frame

Expected: Pink bar should track the keyboard smoothly (frame by frame)

Snack or a link to a repository

https://snack.expo.dev/@aazcarraga/reanimated-useanimatedkeyboard-frame-delay-repro?platform=ios

Reanimated version

3.1.0

React Native version

0.69.5

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo bare workflow

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Real device

Device model

iPhone 14 Pro (iOS 16.4)

Acknowledgements

Yes

Latropos commented 10 months ago

Probably got fixed since we merged: https://github.com/software-mansion/react-native-reanimated/pull/5337 I'll assign myself to remember to test it later

kesha-antonov commented 6 months ago

Probably got fixed since we merged: #5337 I'll assign myself to remember to test it later

This PR looks like only have android changes

But this issue is about iOS

aymather commented 3 months ago

I'm seeing this too. Are there any updates?

piaskowyk commented 3 months ago

In the newest version of Reanimated it should works better

piaskowyk commented 1 week ago

close due to: https://github.com/software-mansion/react-native-reanimated/pull/5750 and https://github.com/software-mansion/react-native-reanimated/pull/5705