Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JetStream crashes on home screem : Focus restoration on navigation popBackStack and focus restoration using state Modifiers #148

Open
ChetanPatelPlayBoxTV opened this issue Jan 12, 2024 · 3 comments

Comments

@ChetanPatelPlayBoxTV
Copy link

ChetanPatelPlayBoxTV commented Jan 12, 2024

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:

  1. Remember the FocusRequester: val focusRequester = remember { FocusRequester() }
  2. Did you forget to add a Modifier.focusRequester() ?
  3. 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)`
@alexzaitsev
Copy link

Have you found a solution @ChetanPatelPlayBoxTV ? Seems to be an issue in FocusRestorer modifier.

@ChetanPatelPlayBoxTV
Copy link
Author

Have you found a solution @ChetanPatelPlayBoxTV ? Seems to be an issue in FocusRestorer modifier.

@alexzaitsev Sorry still I'm facing same issue, it's not resolved.

@ChetanPatelPlayBoxTV
Copy link
Author

any update @AndroidTeam @alexzaitsev @dakkad @tjohns

How can I solved this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants