Skip to content

Animated.View layout animations break with KeyboardAvoidingView #4815

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

Open
joeporpeglia opened this issue Jul 25, 2023 · 11 comments
Open

Animated.View layout animations break with KeyboardAvoidingView #4815

joeporpeglia opened this issue Jul 25, 2023 · 11 comments
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@joeporpeglia
Copy link

joeporpeglia commented Jul 25, 2023

Description

There seems to be some sort of conflict between reanimated and react-native layout animations. Any reanimated views that trigger a layout animation on text input focus/blur look buggy when a KeyboardAvoidingView is also rendered. The following console warning is also printed when this happens: Overriding previous layout animation with new one before the first began.

Related: KeyboardAvoidingView calls LayoutAnimation.configureNext(...) before adjusting the keyboard offset. https://github.com/facebook/react-native/blob/e64756ae5bb5c0607a4d97a134620fafcb132b3b/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js#L146

Example video:

Simulator.Screen.Recording.-.iPhone.14.-.2023-07-25.at.14.12.43.mp4

Steps to reproduce

  1. Run app from linked repository on an iOS simulator
  2. Focus the text input (make sure keyboard is appearing on focus). Note the width animation on the red box
  3. Change the SET_TRUE_TO_REPRO variable to true
  4. Repeat step 2 - the animation no longer works as expected

Snack or a link to a repository

https://github.com/joeporpeglia/repro-reanimated-layout-animations

Reanimated version

3.3.0

React Native version

0.72.3

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo managed workflow

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

iPhone 14

Acknowledgements

Yes

@joeporpeglia joeporpeglia added the Needs review Issue is ready to be reviewed by a maintainer label Jul 25, 2023
@github-actions github-actions bot added Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided labels Jul 25, 2023
@JMinayaT
Copy link

Same problem!

@zispidd
Copy link

zispidd commented Jul 31, 2023

same problem

@ivanfuzuli
Copy link

+1

@lewxdev
Copy link

lewxdev commented Aug 21, 2023

Is there a workaround for this? I ran into the same problem

mvaivre added a commit to alephium/mobile-wallet that referenced this issue Sep 23, 2023
@anckaertv
Copy link

Same here, also have this warning when using LayoutAnimations with rn reanimated in //.

@MatthewPattell
Copy link

For me, it's fixed in 3.5.4 version. Thanks.

@sregg
Copy link

sregg commented Nov 3, 2023

For me, it's fixed in 3.5.4 version. Thanks.

Same for me.

@pluckyhd
Copy link

pluckyhd commented Nov 9, 2023

I am still seeing this issue on IOS but not android.

@borstessi
Copy link

Receiving the same error using KeyboardAvoidingView with Expo SDK49

@matheuscostadesign
Copy link

Receiving the same error using KeyboardAvoidingView with Expo SDK49

Did you find any solution?

@fellipe-ribeiro
Copy link

fellipe-ribeiro commented Jan 19, 2024

I think the real problem is only with react-native's KeyboardAvoidingView on IOS.
This component plays an animation and there is no way to turn it off
The warning in the console even happens when using KeyboardAvoidingView with LayoutAnimation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests