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

Add Keyboard.dismiss() option #23

Closed
multi-vit opened this issue Nov 1, 2022 · 1 comment
Closed

Add Keyboard.dismiss() option #23

multi-vit opened this issue Nov 1, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@multi-vit
Copy link

I'm using your excellent dropdown select (thank you!) as part of a wider form and would love it if I were able to dismiss the open keyboard on pressing the dropdown.

For example, if I've just entered something in a TextInput on the form and then want to select from this element, upon the dropdown opening the keyboard remains open and the first time I try and select an option from the dropdown, that dismisses the keyboard and doesn't actually select the option, I then have to select it again.

I tried to circumvent the need to add it to this repo by wrapping the element with a Touchable that has an onPress of Keyboard.dismiss() but that isn't working. It also doesn't work when wrapping the entire element in a pre-defined HideKeyboard function as suggested here, though this does close the keyboard if you tap anywhere else except the component.

Unless there's another way to do it?

I'm using React-Native with Expo and currently seeing this behaviour on Android. I don't have the means to test it on iPhone at the moment.

I hacked together a little work around by modifying the index.tsx file:

Importing Keyboard on line 2
Adding Keyboard.dismiss() to the onPress function on line 215

Happy to submit this as a PR if you think always automatically closing the keyboard is of value, but the alternative is I thought you might want to add it as a customisable boolean option and my skills aren't at that level yet!

@danish1658 danish1658 added the enhancement New feature or request label Nov 2, 2022
@danish1658
Copy link
Owner

Brilliant, Its actually a good thing. I will definitely add this in the upcoming version, for now i will mark this as enhancement.

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

No branches or pull requests

2 participants