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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [BUG] - SubNav.Link marked as current when aria-current="false" #572

Open
sergioalvz opened this issue Apr 15, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@sergioalvz
Copy link

Describe the bug

Version 0.32.0 of @primer/react-brand incorrectly marks SubNav.Link items as "current" when using aria-current="false". According to MDN, false is a valid value for this attribute.

Currently, the styling for SubNav.Link is activated by the mere presence of the aria-current attribute, rather than by its actual value.

.SubNav__link[aria-current] * {
color: var(--brand-SubNav-color-link-active);
text-decoration: none !important; /* dotcom override */
}

Reproduction steps

https://codepen.io/sergioalvz/pen/rNbrbae

Expected behavior

Only elements with aria-current="page" or aria-current="true" are marked as current

Screenshots

No response

Browsers

No response

OS

No response

@sergioalvz sergioalvz added the bug Something isn't working label Apr 15, 2024
@rezrah
Copy link
Collaborator

rezrah commented Apr 17, 2024

馃憢 @sergioalvz - thanks for opening this issue.

Is there a need to set "false" here instead of undefined? Per MDN guidance, you only need to set the aria-current attribute for current items, it doesn't need to be set for others:

If the attribute is not present, is an empty string, is present with no value, or is set to aria-current="false" it is not exposed to the user.

While I can verify "false" is a valid value, I'm checking that this isn't blocking you right now?

@sergioalvz
Copy link
Author

Hi @rezrah,

I'm checking that this isn't blocking you right now?

No problem. We have changed the code a bit, so we only set aria-current="page" for the current item.

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

No branches or pull requests

3 participants