callstack / callstack/react-native-paper

Allow BottomNavigation to have items unselected

Open
#4,651 1 comment 0 reactions 0 assignees View on GitHub
BottomNavigation feature request
Dominant language
TypeScript
Stars
14.5k
Forks
2.2k
Avg merge
5d 23h
Merged PRs (30d)
12

Description

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
There is the use case where it would make sense that if you are using the BottomNavigation component together with a top navigation component that will open a drawer with multiple menu items, when one of the items selected from the drawer is not also part of the BottomNavigation menu items to have no menu item selected in the bottom navigation component.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
We could check the index of the navigation state, if it is either negative or greater than the routes length, we do not set focus . Then developers can pass either if the user navigates to a different menu that is not part of the bottom navigation.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Material UI seem to support inactive states as per https://m2.material.io/components/bottom-navigation#states

Contributor guide

Open the contributing guide

Research direction

Start by locating the BottomNavigation component and tracing how navigation state determines the selected item. Verify the expected behavior for negative or out-of-range indices and add coverage alongside the component's existing tests. Done means a route outside the bottom-navigation items leaves every item unselected without changing normal selection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
frontend, mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.