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 keyboardDismissMode="on-drag" on Android #31943

Closed
wants to merge 1 commit into from

Conversation

janicduplessis
Copy link
Contributor

@janicduplessis janicduplessis commented Aug 3, 2021

Summary

Fixes #23364

The current logic using _isTouching does not work because _handleTouchCancel is always called before scroll events begin. This means _isTouching is always false. To fix it I moved the logic to _handleScrollBeginDrag which is only called once when scroll drag beings. This accomplishes the expected behavior and is better than keeping it in onScroll where it would be called for each scroll event.

Changelog

[Android] [Fixed] - Fix keyboardDismissMode="on-drag" on Android

Test Plan

Tested in an app that on-drag does not work before and works after this patch.

@facebook-github-bot facebook-github-bot added Contributor A React Native contributor. CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Aug 3, 2021
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 9,181,802 -7,203
android hermes armeabi-v7a 8,708,228 -6,410
android hermes x86 9,623,243 -7,636
android hermes x86_64 9,590,530 -8,086
android jsc arm64-v8a 10,818,202 -7,015
android jsc armeabi-v7a 9,735,906 -6,207
android jsc x86 10,855,041 -7,446
android jsc x86_64 11,463,844 -7,892

Base commit: 8a8a532

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 8a8a532

@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 Aug 12, 2021
@facebook-github-bot
Copy link
Contributor

@yungsters has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@yungsters merged this pull request in 7edf927.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Sep 2, 2021
@janicduplessis janicduplessis deleted the fix-on-drag branch September 2, 2021 21:49
zhxlp pushed a commit to zhxlp/react-native that referenced this pull request Aug 1, 2023
Summary:
Fixes facebook#23364

The current logic using `_isTouching` does not work because `_handleTouchCancel` is always called before scroll events begin. This means `_isTouching` is always false. To fix it I moved the logic to `_handleScrollBeginDrag` which is only called once when scroll drag beings. This accomplishes the expected behavior and is better than keeping it in onScroll where it would be called for each scroll event.

## Changelog

[Android] [Fixed] - Fix keyboardDismissMode="on-drag" on Android

Pull Request resolved: facebook#31943

Test Plan: Tested in an app that on-drag does not work before and works after this patch.

Reviewed By: sshic

Differential Revision: D30674276

Pulled By: yungsters

fbshipit-source-id: aa0bd605809fa01518f70fbf323c06e32c76ed1d
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. Merged This PR has been merged. Needs: React Native Team Attention 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.

keyboardDismissMode = "on-drag" on ScrollView not working with Android
4 participants