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

automaticallyAdjustKeyboardInsets not shifting scrollview content #46595

Closed
acdifran opened this issue Sep 23, 2024 · 4 comments
Closed

automaticallyAdjustKeyboardInsets not shifting scrollview content #46595

acdifran opened this issue Sep 23, 2024 · 4 comments
Labels
API: Keyboard Component: ScrollView Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Resolution: Fixed A PR that fixes this issue has been merged.

Comments

@acdifran
Copy link

acdifran commented Sep 23, 2024

Description

Looking at the explanation and examples of automaticallyAdjustKeyboardInsets here: #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
Screen.Recording.2024-09-23.at.8.12.39.AM.mov
Screen.Recording.2024-09-23.at.12.50.24.AM.mov
@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 labels Sep 23, 2024
@acdifran
Copy link
Author

acdifran commented Sep 23, 2024

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

v49 v51
Screen.Recording.2024-09-23.at.8.11.58.AM.mov
Screen.Recording.2024-09-23.at.8.12.39.AM.mov

@acdifran
Copy link
Author

acdifran commented Sep 25, 2024

This works as expected if there are only a few items and moving the list doesn't push any of them out of view.

Screen.Recording.2024-09-25.at.1.28.02.PM.mov

Maybe it's trying to keep items in view as shown here: #37766, but as described in the PR, I'd expect that to only occur for focused inputs rather than any component. It states "The proposal doesn't change the behavior of the ScrollView offset when an InputAccessory view is used, since it checks if the TextField that triggered the keyboard is a descendant of the ScrollView or not."

@zhongwuzw
Copy link
Contributor

PR #46732 tried to fix it.

@acdifran
Copy link
Author

Any updates on getting this merged?

@migueldaipre migueldaipre added the Resolution: PR Submitted A pull request with a fix has been provided. label Oct 19, 2024
@cortinico cortinico added Resolution: Fixed A PR that fixes this issue has been merged. and removed Resolution: PR Submitted A pull request with a fix has been provided. labels Oct 30, 2024
blakef pushed a commit that referenced this issue Dec 9, 2024
…6732)

Summary:
Fixes #46595 . It seems #37766 broke the `automaticallyAdjustKeyboardInsets` when input accessory view become first responder.

[IOS] [FIXED] - automaticallyAdjustKeyboardInsets not shifting scrollview content

Pull Request resolved: #46732

Test Plan: Repro please see in ##46595 .

Reviewed By: cipolleschi

Differential Revision: D65072478

Pulled By: javache

fbshipit-source-id: 7d5d7566438d4bb0e1d50074a953b18866e324d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: Keyboard Component: ScrollView Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Resolution: Fixed A PR that fixes this issue has been merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants