Closed rwe closed 7 months ago
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.
Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.
Thanks for reporting this! I'm going to close this as a duplicate of https://github.com/primer/react/issues/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.
Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.
@langermank Oh wow, I browsed through the issues but apparently just didn't read closely enough! That does indeed appear to be a dupe.
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: https://github.com/primer/react/blob/3ec63098e159d5b9fb14e044e5134972ca8dbfb8/packages/react/src/ActionList/Item.tsx#L125-L138Those 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: https://github.com/primer/react/blob/3ec63098e159d5b9fb14e044e5134972ca8dbfb8/packages/react/src/ActionList/Item.tsx#L322Without 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 369c3036c8701f227ac5e49b38d32f65f6a8ce97 (at time of issue creation).
Browser
(Not browser-specific) Chrome