Skip to content

[Navigation.Section] -> Make 'items.url' optional for 'items.selected to' work #2988

@mayurc137

Description

@mayurc137

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

  1. Create a Navigation.Section component
  2. Do not set the url value of its items
  3. Try to update the selected value of an item
  4. The Navigation selected tab doesn't update to the selected UI state
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions