Skip to content

[Android] LayoutAnimation during Keyboard dismiss leads to empty space #26551

Closed
@samiede

Description

@samiede

Using LayoutAnimation in conjunction with dismissing the keyboard leads to a weird behaviour in which the app seems to try to show the keyboard layout wise without actually showing the keyboard, but only every other time.

ezgif-2-8a255d583d3c

React Native version:

Binaries:
Node: 12.9.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.10.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 27, 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.0, 29.0.1, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
Android NDK: 20.0.5594570
IDEs:
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5

Steps To Reproduce

  1. Use
LayoutAnimation.configureNext(LayoutAnimation.create(200, 'easeInEaseOut', 'opacity'))

in a function that triggers the keyboard to be dismissed or use the hardware back button
2. Trigger layout change by e.g. changing screens

Describe what you expected to happen:

Layout animation is consumed.

Instead, something seems to trigger a layout change that still has the keyboard extended.

I found a GitHub issue form January of last year of someone having the same problem:
https://stackoverflow.com/questions/48503892/react-native-android-layoutanimation-keyboard-flatview-bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions