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

keyboardDismissMode='on-drag' doesn't work #40

Closed
j1mbl3s opened this issue Sep 23, 2019 · 3 comments
Closed

keyboardDismissMode='on-drag' doesn't work #40

j1mbl3s opened this issue Sep 23, 2019 · 3 comments

Comments

@j1mbl3s
Copy link

j1mbl3s commented Sep 23, 2019

We want to dismiss the keyboard when scrolling to another page. It seems that setting the keyboardDismissMode prop to 'on-drag', for the ScrollView, doesn't do anything. Using onScrollEnd prop is not what we want, because we allow other components to focus after using the scrollToPage(page) method - onScrollEnd={() => Keyboard.dismiss()} results in unwanted behavior.
Edit: Using react-native 0.60.5

@j1mbl3s
Copy link
Author

j1mbl3s commented Sep 23, 2019

A simple solution that I can think of would be to allow hooks to the onScrollBeginDrag() method (and to other ScrollView props that are defined) by allowing the user to set their own onScrollBeginDrag prop and calling like so:

src/components/pages/index.js

  ...
  onScrollBeginDrag() {
    this.scrollState = 0;
    this.props.onScrollBeginDrag();
  }
  ...

This doesn't necessarily fix this problem but would allow users to potentially fix it themselves and add some nice functionality.

@n4kz
Copy link
Owner

n4kz commented Oct 7, 2019

Thanks for issue! Looks like keyboardDismissMode is not working on Android at all for this moment, as described in facebook/react-native#23364. I've added onScrollStart callback and released it in 0.9.0.

@n4kz n4kz closed this as completed Oct 7, 2019
@j1mbl3s
Copy link
Author

j1mbl3s commented Oct 7, 2019

Didn't realize this was an issue with RN's ScrollView itself. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants