Skip to content
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

KeyboardAvoidingView shows the keyboard avoiding area even if the keyboard is closed #46942

Closed
QichenZhu opened this issue Oct 10, 2024 · 2 comments
Labels

Comments

@QichenZhu
Copy link
Contributor

QichenZhu commented Oct 10, 2024

Description

In the new architecture, if you open the soft keyboard, unmount KeyboardAvoidingView, close the keyboard, and then remount KeyboardAvoidingView, it still assumes the keyboard is open and displays the keyboard avoiding area.

This issue may happen during navigation because the KeyboardAvoidingView can be unmounted when you navigate away and remounted when you navigate back.

Steps to reproduce

  1. Build the reproducer with New Arch enabled and run it on iOS.

  2. Click Show Keyboard, and ensure the soft keyboard is visible. If not, enable it in the simulator menu: I/O -> Keyboard -> Toggle Software Keyboard.

  3. Click Freeze, Hide Keyboard, Unfreeze buttons in sequence.

Expected result: No blank area under the grey section.

Actual result: A blank area appears under the grey section.

React Native Version

0.75.4

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
  Memory: 11.68 GB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.15.1
    path: ~/.nvm/versions/node/v20.15.1/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v20.15.1/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v20.15.1/bin/npm
  Watchman:
    version: 2024.07.29.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/penguin/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 3.1.2
    path: /Users/penguin/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.4
    wanted: 0.75.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

N/A

Reproducer

https://github.com/QichenZhu/reproducer-react-native-keyboard-avoiding-view.git

Screenshots and Videos

373094107-d6765f8b-e297-4fef-ad4d-c443843663e2.mp4
@QichenZhu
Copy link
Contributor Author

This is also reproducible on Android.

simplescreenrecorder-2024-10-10_21.18.56.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants
@cortinico @react-native-bot @QichenZhu and others