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

fix(Android): Restore focus on page transitions #2640

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

micheleb
Copy link
Contributor

Description

After #1894 was merged, a refactoring of the native source happened, and the call to lastFocusedChild.requestFocus() that happened on the overridden onStart() method in ScreenStackFragment got lost along the way, making focus disappear when popping a screen from the stack.

Fixes #1706

Changes

  • Updated ScreenStackFragment.kt, resurrecting the old onStart() override (lastFocusedChild is only set on Android TV, so this change only affects that platform)

If lastFocusedChild was set (which only happens on Android TV), call requestFocus() onStart()
@kkafar
Copy link
Member

kkafar commented Jan 23, 2025

Yeah, the code was accidentally removed in #2045. Thanks a lot!

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally removed in #2045. Thanks!

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

Successfully merging this pull request may close these issues.

[ANDROID TV] Focus gets lost between page transitions
2 participants