-
Notifications
You must be signed in to change notification settings - Fork 81
Update aria roles on mzp navigation #860
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
Conversation
7ca1969
to
e767540
Compare
Added a feature detection check to support IE and older browsers - the method that I decided to use, |
e767540
to
13a106e
Compare
Navigation.setAria(); | ||
} | ||
}; | ||
|
||
/** | ||
* Initialise menu. | ||
* Initialize menu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🇺🇸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it! oops - it just showed up on the spell checker 😿
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I just meant to tease for the change from 🇨🇦 to 🇺🇸 . It's a good change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this took me a while to get round to looking at. It looks good! I like the idea of using IntersectionObserver for things like this 👍
A few small issues / fix-ups below, but it works well for me :)
Thanks @alexgibson - thought InteractionObserver was the best way to detect the change in CSS when an element is going from display:none to being displayed on a page. |
bb71325
to
f8bcd1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested fixes look good, but I'm not sure if the new code is triggering? It seems to be falling back to the else clause (because the feature detect is named slightly differently I think).
Also, let's make sure we update the changelog for this bug fix before we merge! 👍
There were some fairly big changes that landed in #867, so to (hopefully) make things easier I took a go at rebasing your branch here. I opened a new PR, to make viewing the changes easier. I didn't change or update anything, so probably best check I didn't miss anything? Feel free to use my commit / branch below in whatever way works best here: |
f8bcd1c
to
3ac4b6b
Compare
@alexgibson Thanks for making the PR! It was helpful as I was going through the rebase - I made sure that I was using the right MzpSupports check 🤦🏻 - let me know if you see anything that should be flagged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a rebase, but aside from a couple of minor nits / suggestions the updates look good r+wc 👍
d44a634
to
c050a12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+!
Description
Moves the
aria-expanded
attribute to themzp-c-navigation-menu-button
instead of the menu items as explained in #847. Also removes the aria-expanded attribute on desktop since the element is not displayed, so firefox no longer includes it in the accessibility tree.Issue
#847
Testing
You can test this by running a local server and navigating to this page: http://localhost:3000/components/preview/navigation--default and using the inspector to view the element and make sure that the aria-expanded role is toggling correctly.