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

Navbar: Add aria-label attribute #2379

Merged
merged 7 commits into from
May 10, 2024

Conversation

austinoneil
Copy link
Contributor

@austinoneil austinoneil commented Mar 30, 2024

Description

Add aria-label attribute to navbar.

References #2212

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

e2e tests, inspect element on storybook

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Copy link

netlify bot commented Mar 30, 2024

Deploy Preview for moduswebcomponents ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f3f628a
🔍 Latest deploy log https://app.netlify.com/sites/moduswebcomponents/deploys/66397d5c1db8b000089a9cf2
😎 Deploy Preview https://deploy-preview-2379--moduswebcomponents.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 26 (no change from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@coliff coliff self-requested a review April 1, 2024 00:18
@coliff coliff changed the title Add aria-label attribute to navbar Navbar: Add aria-label attribute Apr 1, 2024
@@ -364,7 +367,7 @@ export class ModusNavbar {

return (
<Host id={this.componentId}>
<nav class={`${direction} ${shadow} ${variant}`}>
<nav class={`${direction} ${shadow} ${variant}`} aria-label={this.ariaLabel}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no aria-label is set then it renders as <nav class aria-label> - however it shouldn't show aria-label at all if not specified. Can you fix that please? By default it shouldn't have an aria-label at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to reproduce this locally. When running locally, I got desired behavior. I added some unit tests for these user journeys.

Copy link
Member

@coliff coliff Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Adding aria-label to the <modus-navbar> is problematic, I think it should be on the <nav> only.

See Accessibility issues at: https://deploy-preview-2379--moduswebcomponents.netlify.app/?path=/story/components-navbar--default

@austinoneil
Copy link
Contributor Author

I changed the prop name to navAriaLabel and update documentation/tests.

@coliff
Copy link
Member

coliff commented Apr 4, 2024

It's still rendering empty aria-label if no aria-label is specified but it shouldn't. See code here:

image

@coliff coliff self-requested a review April 25, 2024 02:12
@coliff
Copy link
Member

coliff commented May 2, 2024

Hi @austinoneil - the outstanding issue on this has been resolved now with your merged PR (empty aria-label fix) so once the conflicts are resolved here we can merge too. thanks :-)

@coliff
Copy link
Member

coliff commented May 3, 2024

@coliff coliff marked this pull request as draft May 3, 2024 01:40
@austinoneil austinoneil marked this pull request as ready for review May 5, 2024 06:49
@coliff
Copy link
Member

coliff commented May 5, 2024

doesn't seem to work:
https://deploy-preview-2379--moduswebcomponents.netlify.app/?path=/story/components-navbar--default&args=ariaLabel:default
This link should give the navbar an aria-label with default value but no value is given... its just rendered as <nav class="" aria-label="">

@austinoneil
Copy link
Contributor Author

@coliff fixed.

@coliff coliff merged commit 16706ab into trimble-oss:main May 10, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants