React Native WebView hardware keyboard focus skipping first element

277 views Asked by At

I have a password confirmation form inside WebView and I need it to be usable with hardware keyboard. When I connect hardware keyboard and hit Tab, once focus enters WebView component it skips first focusable element and goes to the second one. Here's simplified version of the screen. Video. Has anyone faced this issue and how do you overcome it?

I use react-native-webview library. enter image description here

1

There are 1 answers

0
khandaniel On

As a workaround: inside the page that appears inside the WebView add following

document.body.tabIndex = 0;

This will set body as first focusable element and focus will jump over it (almost invisible).