Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavList: Fix when subNav opens automatically and shows current indicator #3611

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Aug 9, 2023

Before: If the second item is selected, NavList does not open the subNav automatically and does not show current indicator at the subNav level when folded

before-navlist.mov

After: If the second item is selected, NavList does open subNav automatically and shows the current indicator at the subNav level

after-navlist.mov

Implementation detail

While we did check for aria-current !== false, we did this for the first element with aria-current, which could be the one with aria-current=false :)

Changing the selector to exclude false value takes care of this.

- subNavRef.current.querySelector('[aria-current]')
+ subNavRef.current.querySelector('[aria-current]:not([aria-current=false])')

@siddharthkp siddharthkp added bug Something isn't working patch release bug fixes, docs, housekeeping react labels Aug 9, 2023
@siddharthkp siddharthkp self-assigned this Aug 9, 2023
@siddharthkp siddharthkp requested review from a team and broccolinisoup August 9, 2023 14:58
@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2023

🦋 Changeset detected

Latest commit: 8b84b33

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@siddharthkp siddharthkp requested review from joshblack and removed request for broccolinisoup August 9, 2023 14:59
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 103.64 KB (-0.01% 🔽)
dist/browser.umd.js 104.21 KB (-0.01% 🔽)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch release bug fixes, docs, housekeeping react
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants