Skip to content

Conversation

@johankasperi
Copy link
Contributor

Description

onNativeFocusChange is called on android after closing a screen "on top of" a screen having bottom tabs. This is because we are setting bottomNavigationView.selectedItemId in updateBottomNavigationViewAppearance even though it have not changed because onNavigationItemSelectedListener is notified on reselect

This differs from the implementation on iOS (where onNativeFocusChange is only called on tab press) and creates some problems. For example will "tab press" be emitted in react-navigation causing the scrollview in the tab to scroll to top after closing a modal. Or if there is a nested stack in the tab, the stack will pop to the route on index 0.

Changes

Check that selectedItemId has changed before setting it to bottomNavigationView.selectedItemId

Screenshots / GIFs

Before

Screen.Recording.2025-11-10.at.20.44.33.mov

After

Screen.Recording.2025-11-10.at.20.46.07.mov

Test code and steps to reproduce

I've created a new test named "Test3384".

Checklist

@johankasperi johankasperi changed the title fix(android): check if selectedItemId has changed before setting fix(android): check if selectedItemId has changed before setting Nov 10, 2025
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.

1 participant