react-native-rich-editor
react-native-rich-editor copied to clipboard
Keyboard not closing when focusing on an outside input
I have a dropdown input on the same view as the rich text editor.
- I select the rich text editor. The keyboard appears.
- I tap the drowndown input, the keyboard remains and the dropdown menu appears behind the keyboard.
How can I blur the editor properly when I select the dropdown?
Thanks for the library.
Any luck on this?
for future readers, there is a workaround to do in this case:
you can wrapper your page with a TouchableWithoutFeedback
, and verifying these two props _focus
and _keyOpen
to dismiss the keyboard, something like this:
...
const ref = useRef(null);
return (
<TouchableWithoutFeedback onPress={() => {
if (ref.current?._focus && ref.current?._keyOpen) {
ref.current?.blurContentEditor();
}
}}>
...
<RichEditor ref={ref} />
...
</TouchableWithoutFeedback>
)
...
btw, my lib version is 1.8.8

You can also add keyboard handling buttons in the toolbar, in addition to using blurContentEditor