react-native: keyboardDismissMode = "on-drag" on ScrollView not working with Android
š Bug Report
When scrolling in ScrollView
when device keyboard active, on Android emulator keyboardDismissMode = "on-drag"
does not close the keyboard
To Reproduce
<ScrollView keyboardDismissMode = "on-drag"> {content} </ScrollView>
Expected Behavior
Keyboard should close when scrolling on Android device.
Code Example
Minimal Expo example https://snack.expo.io/@hakkikonu/scrollview-bug
Environment
react-native info
output:
React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (8) x64 IntelĀ® Coreā¢ i7-4770HQ CPU @ 2.20GHz
Memory: 369.48 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 15, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
Build Tools: 19.1.0, 20.0.0, 21.1.2, 22.0.1, 25.0.0, 26.0.2, 27.0.0, 28.0.3
System Images: android-15 | Intel x86 Atom, android-19 | ARM EABI v7a, android-19 | Intel x86 Atom, android-21 | Android TV ARM EABI v7a, android-21 | Android TV Intel x86 Atom, android-21 | Android Wear ARM EABI v7a, android-21 | Android Wear Intel x86 Atom, android-21 | ARM EABI v7a, android-21 | Intel x86 Atom, android-21 | Intel x86 Atom_64, android-21 | Google APIs ARM EABI v7a, android-21 | Google APIs Intel x86 Atom, android-21 | Google APIs Intel x86 Atom_64, android-22 | ARM EABI v7a, android-22 | Intel x86 Atom, android-22 | Intel x86 Atom_64, android-22 | Google APIs ARM EABI v7a, android-22 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom_64, android-23 | Google APIs ARM EABI v7a, android-23 | Google APIs Intel x86 Atom_64, android-25 | Google APIs Intel x86 Atom_64, android-25 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.4 => 0.58.4
npmGlobalPackages:
react-native-cli: 2.0.1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 32
- Comments: 28 (1 by maintainers)
Commits related to this issue
- React Native sync for revisions 4de99b3...1780659 Summary: This sync includes the following changes: - **[17806594c](https://github.com/facebook/react/commit/17806594c )**: Move createRoot/hydrateRoo... — committed to facebook/react-native by kacieb 2 years ago
- React Native sync for revisions 4de99b3...1780659 Summary: This sync includes the following changes: - **[17806594c](https://github.com/facebook/react/commit/17806594c )**: Move createRoot/hydrateRoo... — committed to Saadnajmi/react-native-macos by kacieb 2 years ago
- 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 `_handleTouchCa... — committed to zhxlp/react-native by janicduplessis 3 years ago
@yasir-netlinks this is the current workaround
Not fixed, stupid bot
TLDR
This functionality was never implemented for android and this is a feature request
LONG VERIONS
I think this functionality was never implemented on android
https://github.com/facebook/react-native/blob/9263eb5d3864a42925b699343db2c09cc8934ed0/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java#L155
but somehow was included in the documents which should be updatedā¦
The best way to have functionalities like this is using this workaround from @shyaniv7
as the workaround is easy to implement, while getting a pull request reviewed it is very hardā¦ I would not consider writing a pr for this
my
react-native+0.63.2.patch
based on #26422my workaround for now is to call Keyboard.dismiss() in my onScroll function. Its definitely annoying
Hi, same problem here. It still presents on React Native 0.61.5
No bot.
And no, thereās already PR which fixes it: https://github.com/facebook/react-native/pull/26422
Iām using by monkey patching with patch-package, and it works. So merging that would be nice.
RN
0.59.8
still has the same issue here on Android.