focus() and Blur() programmatically stopped working for View
The problem Views have stopped responding to focus() and blur() methods when done programatically after 0.8.0. It was working well in 0.7.3
How to reproduce
Simplified test case: https://codesandbox.io/s/xowm2yw084
Steps to reproduce:
- create a reference to a view
- call focus() on the ref programatically
Expected behavior The view needs to be focussed programmatically similar to how it does when going through components using the tab key.
Environment (include versions). Did this work in previous versions? It worked as expected in
- React Native for Web (version): 0.7.3
- React (version): "16.3.1"
- Browser: Chrome 67.0.3396.87
The test case is using 0.7.3
I think the problem here is that you're using tabIndex which is no longer forwarded to the underlying DOM node. You can read more about the change in the release notes for 0.8.0
That seems to be the case. Is there a work around to pass that prop to the underlying Node ? or any other alternative to using tabIndex ?
https://github.com/necolas/react-native-web/blob/master/packages/website/guides/accessibility.md