fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Bug]: Selected NavSubItem shows no indicator inside expanded NavCategory

Open marcOcram opened this issue 2 months ago • 3 comments

Component

Nav (Preview)

Package version

9.74.7

React version

19.3.0

Environment

System:
  OS: Windows 11 10.0.26200
  CPU: (20) x64 Intel(R) Core(TM) Ultra 7 265HX
  Memory: 8.44 GB / 31.68 GB
Browsers:
  Edge: Chromium (152.0.4191.53)
npmPackages:
  @fluentui/react-components: ^9.74.7 => 9.74.7 
  @fluentui/react-icons: ^2.0.339 => 2.0.340 
  @types/react: ^19.2.18 => 19.3.0 
  @types/react-dom: ^19.2.4 => 19.3.0 
  react: ^19.2.8 => 19.3.0 
  react-dom: ^19.2.8 => 19.3.0

Current Behavior

When a NavSubItem inside an expanded NavCategory is selected (selectedValue matches its value), its selection indicator is not visible.

Image

The indicator pseudo-element (::after) is positioned with inset-inline-start: 46px and margin-inline-start: -52px, i.e. 6 px outside the item's box.

Expected Behavior

A selected NavSubItem shows its selection indicator while its category is expanded, aligned with the indicators of top-level NavItems.

Image

Reproduction

https://stackblitz.com/edit/drvr8jcg?file=src%2Fexample.tsx

Steps to reproduce

  1. Open "Job Postings"
  2. Click on "Openings"

Are you reporting an Accessibility issue?

No response

Suggested severity

Medium - Has workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [x] The provided reproduction is a minimal reproducible example of the bug.

marcOcram avatar Sep 17 '26 09:09 marcOcram

The workaround is to adjust the margin and padding.

const useStyles = makeStyles({
  subItemGroup: {
    marginInlineStart: '-6px',
    paddingInlineStart: '6px',
  },
})

<NavSubItemGroup className={styles.subItemGroup}>…</NavSubItemGroup>

marcOcram avatar Sep 17 '26 09:09 marcOcram

Thanks for the reproduction and workaround. The reported behavior is consistent with the selected NavSubItem indicator being clipped by NavSubItemGroup’s overflow styling. Routing this to the Nav owner for investigation.

tudorpopams avatar Sep 17 '26 12:09 tudorpopams

verified from my end, will be raising a pr soon enough!

Geervan avatar Sep 22 '26 12:09 Geervan