SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Fix keyboardDismissMode="on-drag" on Android (#31943)

Summary:
Fixes https://github.com/facebook/react-native/issues/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: https://github.com/facebook/react-native/pull/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
J
Janic Duplessis committed
7edf9274cf6d3398075c19cd1cb020a5d6a346a2
Parent: a40f973
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 9/2/2021, 8:20:04 PM