SteffeyDev / react-native-popover-view

A well-tested, adaptable, lightweight <Popover> component for react-native
MIT License
613 stars 92 forks source link

Prevent the pop-up from closing the keyboard #83

Closed FlorianPfisterer closed 4 years ago

FlorianPfisterer commented 4 years ago

Is your feature request related to a problem? Please describe. We have a bar that's above the keyboard which offers additional buttons to the user. When the user clicks on a button in this bar, we open a pop-up. However, this always closes the keyboard, which is not our intended behavior.

Describe the solution you'd like Maybe this does not even require an update, and you can tell us how to prevent the pop-up. Otherwise, an update that allows one to choose the behavior via a triggerKeyboard: boolean property (or similar), that is true by default.

Thank you!

SteffeyDev commented 4 years ago

This is an interesting one. Can you confirm that it is indeed opening the popover that closes the keyboard, and not clicking the button? For example, if the button triggers an alert instead of opening a popover, does the keyboard stay open?

The keyboard is probably closing because the text field is losing focus. Are you using the popover in tooltip mode or just the default (rn-modal) mode? You'll probably need to use tooltip or js-modal for this, and then be careful how the view containing the popover is laid out.

FlorianPfisterer commented 4 years ago

Thanks for the fast response! Yes, indeed it's the popover. If the button triggers an alert instead, the keyboard stays open.

However, your suggestion of using the 'js-modal' mode worked. Thank you!