You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current/active state of a NavList.Item is controlled by the aria-current property which drives the ActionList.LinkItem → ActionList.Item's active property. That property then decides whether ActionList.Item's isActive styles are applied:
Those styles are all correctly applied to the container LiBox.
However, (unless a "Description" heading element occurs, which is not desired here and is not shown in the above expected examples), fontWeight is overridden immediately:
Uh oh! @rwe, the image you shared is missing helpful alt text. Check your issue body.
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.
Thanks for reporting this! I'm going to close this as a duplicate of #4367, but there's a fix ready to merge that will probably be in the next release.
Uh oh! @rwe, the image you shared is missing helpful alt text. Check your issue body.
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.
Description
Active
NavList.Item
s do not have the expected bold styling. Note that this appears to be a bug, diagnosed below, and not browser-specific.❌ Actual:
@primer/react
Compare with expected styling on GitHub's own use of the component:
✅ Expected (via github.com):
And the screenshot from the NavList docs themselves:
✅ Expected (via docs)
Diagnosis
The current/active state of a
NavList.Item
is controlled by thearia-current
property which drives theActionList.LinkItem
→ActionList.Item
'sactive
property. That property then decides whetherActionList.Item
'sisActive
styles are applied:react/packages/react/src/ActionList/Item.tsx
Lines 125 to 138 in 3ec6309
Those styles are all correctly applied to the container
LiBox
.However, (unless a "Description" heading element occurs, which is not desired here and is not shown in the above expected examples),
fontWeight
is overridden immediately:react/packages/react/src/ActionList/Item.tsx
Line 322 in 3ec6309
Without being too familiar with the codebase or
StyledComponents
in general, it seems a possible fix might be something like:Steps to reproduce
This is visible in the current storybook: https://primer.style/react/storybook/?path=/story/components-navlist--simple
whose code is given as:
It occurs with any simple NavList with a "current" item, and I believe also with a basic
ActionList.Item
.Version
36.9.0
Through 369c303 (at time of issue creation).
Browser
(Not browser-specific)
Chrome
The text was updated successfully, but these errors were encountered: