facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.41k stars 24.25k forks source link

automaticallyAdjustKeyboardInsets not shifting scrollview content #46595

Open acdifran opened 1 day ago

acdifran commented 1 day ago

Description

Looking at the explanation and examples of automaticallyAdjustKeyboardInsets here: https://github.com/facebook/react-native/pull/31402, I'd expect scrollview content to shift upwards when focusing an input in InputAccessoryView, but it doesn't. Instead the keyboard covers the bottom portion of the content and you need to manually scroll back up.

Steps to reproduce

  1. Load the snack
  2. Focus the input
  3. Observe the bottom portion of the list is covered

React Native Version

0.75.3

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.4.1
  CPU: (12) arm64 Apple M2 Max
  Memory: 3.77 GB / 96.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.15.0
    path: ~/.nvm/versions/node/v20.15.0/bin/node
  Yarn: Not Found
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v20.15.0/bin/npm
  Watchman:
    version: 2024.07.08.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/anthony.difrancesco/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.6
    path: /usr/bin/javac
  Ruby:
    version: 3.3.3
    path: /Users/anthony.difrancesco/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.75.3
    wanted: ~0.75.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: false
  newArchEnabled: false

Stacktrace or Logs

N/A

Reproducer

https://snack.expo.dev/@acdifran/interactive-keyboard

Screenshots and Videos

Observed Expected
acdifran commented 1 day ago

I tried different expo versions in the snack and it works as expected on v49

v49 v51