react-native-screens
react-native-screens copied to clipboard
fix(Android): Restore TV focus in Jetpack Compose views
Description
Currently, when navigating back to a screen containing a Compose-based view, lastFocusedChild is assigned to the internal AndroidComposeView leaving the screen without any focused element.
Instead of targeting the internal AndroidComposeView, Screens would restore it now to it's Android layout parent, that all custom RN views have, allowing developers to restore it back to compose via listeners or overriding the requestFocus method.
Changes
Restore focus from Jetpack Compose views to the parent Android layout, allowing to redirect it back to Compose via focus listeners/overriding requestFocus