tv-samples
tv-samples copied to clipboard
JetStream crashes on home screem : Focus restoration on navigation popBackStack and focus restoration using state Modifiers
In the JetStream tv app sample, it has a createInitialFocusRestorerModifiers() function which acts as the focus restorers of a TvLazyRow/Column for its children.
When I tried to scroll to the end item of the list - making the first item hidden from the current view - and tried to go to my second screen and immediately pop back from it, the app constantly throws:
` java.lang.IllegalStateException: FocusRequester is not initialized. Here are some possible fixes:
- Remember the FocusRequester: val focusRequester = remember { FocusRequester() }
- Did you forget to add a Modifier.focusRequester() ?
- Are you attempting to request focus during composition? Focus requests should be made in response to some event. Eg Modifier.clickable { focusRequester.requestFocus() } at androidx.compose.ui.focus.FocusRequester.focus$ui_release(FocusRequester.kt:259) at androidx.compose.ui.focus.FocusTransactionsKt.performCustomEnter-Mxy_nc0(FocusTransactions.kt:293) at androidx.compose.ui.focus.FocusTransactionsKt.performCustomRequestFocus-Mxy_nc0(FocusTransactions.kt:271)`