question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

🐛 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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:32
  • Comments:28

github_iconTop GitHub Comments

37reactions
andidevcommented, Sep 10, 2019

@yasir-netlinks this is the current workaround

onScrollBeginDrag={Keyboard.dismiss}
25reactions
fungilationcommented, Mar 28, 2020

Not fixed, stupid bot

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native "interactive" keyboardDismissMode throws error ...
I am not sure why it isn't a bigger issue, maybe because it is intermittent, isolated to IOS and an input inside a...
Read more >
keyboardDismissMode | Apple Developer Documentation
Dismissing the keyboard​​ Constants that determine how the system dismisses the keyboard when a drag begins in the scroll view.
Read more >
Today's React Native Tip: Keyboard issues in ScrollView
The keyboardDismissMode property can be set inside the ScrollView. Setting it to on-drag, ensures that the keyboard is dismissed when a drag begins....
Read more >
Keyboard issues in ScrollView. - Our Blogs
The keyboardDismissMode property can be set inside the ScrollView. Setting it to on-drag, ensures that the keyboard is dismissed when a drag ...
Read more >
UIKit Keyboard Avoidance with a single line of code - eppz!
keyboardLayoutGuide to pin any view to the top of the keyboard. Not to mention UIScrollView.keyboardDismissMode API (introduced in iOS 7), which ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found