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

fix infinite updates from KeyboardAvoidingView #48181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Dec 9, 2024

Summary:

Fixes #45192. In the issue, it has two different issues and coming from different root cause actually:

  1. in the repro 1, it is because android onLayout/keyboardDidShow convert size between pixel and dp. it comes with round-off error. the non-integer number does not fall into the return statement and goes into infinite setState -> onLayout calls.
  2. in the repro 2, it is because the keyboardVerticalOffset props. when keyboardDidHide, the keyboardY should not count for keyboardVerticalOffset.

Changelog:

[ANDROID] [FIXED] - Fixed infinite updates from KeyboardAvoidingView

Test Plan:

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. p: Expo Partner: Expo Partner labels Dec 9, 2024
@Kudo Kudo marked this pull request as ready for review December 9, 2024 14:55
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyboardAvoidingView infinitely updates on Android
2 participants