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

fix(navigation-drawer): fix ARIA role issue warning. #14976

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

desig9stein
Copy link
Contributor

@desig9stein desig9stein commented Oct 29, 2024

Change <aside> to a simple <div>, and remove role="navigation" since we're using <nav>, which is a semantic tag that doesn’t need to be wrapped in an element with a role="navigation".

Closes #14847

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

…e the role="navigation" since we use <nav> which is semantic tag and there is no need to be wrapped in an element with a role.
@desig9stein desig9stein added ❌ status: awaiting-test PRs awaiting manual verification ♿ a11y When the issue or PR is related to accessibility navdrawer version: 18.2.x version: 19.0.x labels Oct 29, 2024
@desig9stein desig9stein requested a review from simeonoff October 29, 2024 07:53
@simeonoff simeonoff changed the title fix(navigation-drawer) - fix ARIA role issue warning. fix(navigation-drawer): fix ARIA role issue warning. Oct 29, 2024
simeonoff
simeonoff previously approved these changes Oct 29, 2024
@@ -14,7 +14,7 @@
[class.igx-nav-drawer--disable-animation]="disableAnimation"
(click)="close()" #overlay>
</div>
<aside role="navigation"
<div
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the correct semantic element be <nav>?

Copy link
Contributor Author

@desig9stein desig9stein Oct 30, 2024

Choose a reason for hiding this comment

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

In the app we already have the <nav> element inside, that's why I changed it to div, I removed the role since we are using the semantic <nav> element, and no role is needed for it.

image

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 think we should leave that for the user to decide, we don't know what will be inside, if we change it to nav this means that the drawer can only be used for navigation purposes, if that's what we want. then OK, I will change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@simeonoff, @damyanpetev, what is your opinion?

Copy link
Member

Choose a reason for hiding this comment

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

@desig9stein I'm saying this because so far, we'd decided by putting role="navigation".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kdinev you are correct, otherwise I will introduce a breaking change.

Copy link
Member

@damyanpetev damyanpetev left a comment

Choose a reason for hiding this comment

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

Yup, from what I can see from the few sites I checked out (https://www.youtube.com, https://developer.mozilla.org/en-US/docs/Web, https://m3.material.io and https://w3c.github.io/aria/) just navigation seems to be quite enough.
Not sure where the aside came from, I probably took it from the simpler MDN description that mentions sidebar, but looking at https://w3c.github.io/aria/#complementary it seems it's intended for other purposes.

Anyway, will this involve an update on the docs too? Because those instruct users to add their own <nav> manually as well which shouldn't be needed even if it's not technically wrong. www.infragistics.com/products/ignite-ui-angular/angular/components/navdrawer

@desig9stein
Copy link
Contributor Author

www.infragistics.com/products/ignite-ui-angular/angular/components/navdrawer

Yes @damyanpetev, thanks for pointing this out, I will update the doc samples as well

@kdinev kdinev added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Nov 4, 2024
@kdinev kdinev merged commit 9ca4382 into master Nov 4, 2024
5 checks passed
@kdinev kdinev deleted the mpopov/fix-for-#14847-M branch November 4, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
navdrawer version: 19.0.x ♿ a11y When the issue or PR is related to accessibility ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

igx-nav-drawer uses aside semantic element with incompatible role
4 participants