-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Issue summary
Navigation.Section -> items.url required for items.selected to work
Expected behavior
When changing tab through nextjs/router the Navigation.Sections items.selected state if updated irrespective of the url being set. When the router changes and the items.selected is set the UI state of the navigation tab should change to selected.
Actual behavior
Navigation.Section -> items.selected doesn't work if url is not set in the Navigation Section items array. I am changing the route through nextjs/router. When setting the route trying to update
items.selected attribute it doesn't update the selected Navigation item.
<Navigation.Section items={[ { label: 'Label', icon: ArrowLeftMinor, selected:true }, ]} />
Steps to reproduce the problem
- Create a Navigation.Section component
- Do not set the url value of its items
- Try to update the selected value of an item
- The Navigation selected tab doesn't update to the selected UI state
- When url is mentioned the Naviation selected tab updates its UI state
Reduced test case
The best way to get your bug fixed is to provide a reduced test case. This CodeSandbox template is a great starting point.
Specifications
System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
Memory: 83.68 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 9.9.0 - ~/.nvm/versions/node/v9.9.0/bin/node
Yarn: 1.3.2 - ~/.yarn/bin/yarn
npm: 6.14.2 - ~/.nvm/versions/node/v9.9.0/bin/npm
Browsers:
Safari: 13.0.5