react-native-keyevent
react-native-keyevent copied to clipboard
Does not work when the focus is inside webview.
The listener (KeyEvent.onKeyDownListener()) does not work when the focus is inside webview. (on Android TV)
Would also love support for this
I faced a similar problem, maybe a year ago.
I've fork react-native-webview
and add method ref.requesFocus()
, its's already in master.
You need to focus on WebView to trigger key events on the component.
Previously I've done this with a focus on inputs inside WebView, but this sometimes leads to unexpected behavior.
I hope I understand properly and it will help you.
@marcupan I'm trying to capture keyevents in the parent of the WebView, but the issue is that when i make the WebView (a video) go fullscreen, i'm having trouble getting the fullscreen to release focus to my component so i can register the keypresses
Any update on this?