-
Notifications
You must be signed in to change notification settings - Fork 350
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
Add example of disclosure navigation with top-level links #1614
Conversation
Regression test coverage:Examples without any regression tests:
Examples missing some regression tests:
Example pages with Keyboard or Attribute table rows that do not have data-test-ids:
SUMMARY:56 example pages found. ERROR - missing tests: Please write missing tests for this report to pass. |
Looks good! Keyboard works well, i.e. tab, arrows, home, end, space, enter, escape - and various combinations of tab and arrows - all work intuitively. Will try screen readers later. Couple of notes:
|
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 is an approving code review, looks good!
Can you add the open in codepen button?
For tests: so much of the code and functionality is the same between this example and "Disclosure for Navigation Menus" is the same. You can certainly just copy over the relevant tests.
@smhigley , looking awesome! I have two questions. First, The buttons are labeled like "Show About section". The word "section" doesn't quite feel right; makes me think it is going to show a section of content. I'm wondering if it should be something like "show links for About section" or "Show links to About pages" Second, as part of a quest for consistency among related examples, would you be OK with making the sample content look and feel the way Jon has it set up in the tree example and upcoming new version of the menubar example? See #1558. On those pages, he kind of made a mini web site inside the example. It has a header, footer, and the main content region is labeled by the site name and H1. One of his objectives was to put a couple focusable elements inside the main content region. Note that he used role region, not main. There are comments about that in the source and in the documentation tables. |
Hi @smhigley! Thanks for adding the codepen button. If you notice, the links don't work in a very friendly way in Codepen, it takes you back to the the APG webpage when you click on them. @carmacleod and I looked into ways to make the example work on both the APG webpage and in codepen on this similar example you wrote: #1651 (comment) What do you think of preventing the default behavior of the onclick button so that if will work in the codepen example? |
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.
Just looked over your tests, @smhigley , this is an approving test review!
@spectranaut Thanks for the review! I'll add the preventDefault to the example links, and push it up together with a test fix, as soon as I figure out what's making them fail 😅 |
I think |
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.
Not sure if this is the prettiest way to prevent the initial show-hide flash, but it does work. :)
<button type="button" aria-expanded="true" aria-controls="id_about_menu" aria-label="Show About section"> </button> | ||
<ul id="id_about_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.
Can we start all of the buttons off in the collapsed state so that there's no initial flash when the ul is hidden?
<button type="button" aria-expanded="true" aria-controls="id_about_menu" aria-label="Show About section"> </button> | |
<ul id="id_about_menu"> | |
<button type="button" aria-expanded="false" aria-controls="id_about_menu" aria-label="Show About section"> </button> | |
<ul id="id_about_menu" style="display: none;"> |
<button type="button" aria-expanded="true" aria-controls="id_admissions_menu" aria-label="Show Admissions section"> </button> | ||
<ul id="id_admissions_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.
Prevent initial flash.
<button type="button" aria-expanded="true" aria-controls="id_admissions_menu" aria-label="Show Admissions section"> </button> | |
<ul id="id_admissions_menu"> | |
<button type="button" aria-expanded="false" aria-controls="id_admissions_menu" aria-label="Show Admissions section"> </button> | |
<ul id="id_admissions_menu" style="display: none;"> |
<button type="button" aria-expanded="true" aria-controls="id_academics_menu" aria-label="Show Academics section"> </button> | ||
<ul id="id_academics_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.
Prevent initial flash.
<button type="button" aria-expanded="true" aria-controls="id_academics_menu" aria-label="Show Academics section"> </button> | |
<ul id="id_academics_menu"> | |
<button type="button" aria-expanded="false" aria-controls="id_academics_menu" aria-label="Show Academics section"> </button> | |
<ul id="id_academics_menu" style="display: none;"> |
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.
I thought we did this so that if JS weren't enabled or didn't load, it would still work. Is that not a concern we're targeting?
9a79e3a
to
66ac674
Compare
@smhigley |
I checked the current example with VoiceOver and it works well. Keyboard navigation also works as documented. |
I could not find the same visual discloaure navigation implementation from popular sites yet. However, the closest visual design as well as its coding to current menu example can be found at WAI tutorial, Flyout menu, use button as toogle. |
I am waiting for the most updated preview link before I finish accessiblity review. |
@a11ydoer the preview link is up to date. I don't see any comment from Matt on the button labels -- what was the feedback? I'm also not sure I understand your comment on the WAI tutorial. Were you suggesting we add a link to it from the example page? I'd be happy to add one if so; just let me know where you want it :). |
@smhigley thanks for the updated preview link. I will do the review. You can ignore my wai example comment. It is simple justification method for visual review by me. I am trying to make sense for APG design with other design example. WAI is the one I could find as the similar one to current example. |
@smhigley Thanks for hiding the dropdowns on load! When the user clicks on a link, should focus go to the mythical-page-content div instead of going to body or staying on the anchor? Focusing body (i.e. after clicking link in dropdown) unfortunately causes NVDA to read out the page title (several times in Firefox), and keeping focus on the link (i.e. after clicking one of the top-level links) causes NVDA to say nothing at all in Chrome (and "current page" in Firefox). JAWS behavior is similar. |
@smhigley Glad to see an example for this pattern in the APG! IMHO, the labels for the disclosure buttons are very verbose for screen reader users, and all start with the same three syllables ("Show links to") rather than the most significant information being placed upfront. As a related note, the verb "show" is probably unnecessary, because the use of Not sure on the best wording, but I'd definitely like to see the name of the section come first. Maybe just, "About sub-menu", "About section", "About pages", or similar? |
@jscholes / @a11ydoer the disclosure button label was @mcking65's suggestion, so I want to make sure he gets the chance to review and approve the change. I'm happy to change it to anything :). Another possibility might be something simple like "Admissions submenu" -- I know "submenu" and "menu" means something specific in ARIA, but for general labeling I think it might fit well here. @a11ydoer I'll update that title too :) |
FWIW, this wording (sub-menu) is what I recommend to clients implementing such a pattern. I've come across quite a few cases of this pattern being implemented mostly correctly in the wild, but with really verbose messaging for the buttons. This example list only has three disclosures, but it's not unusual to have six or more. |
@shirsha I can't reproduce with JAWS 2020, NVDA 2020, and Chrome 88. The link behavior is entirely handled by the browser though, so I don't think it would be related to the code in this example. |
@smhigley I used JAWS 2021 , NVDA 2020.3 , Chrome 88.0.4324.190 |
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.
- aria-label, more [name] pages was confirmed through the review.
- emphasis on how this example is different from aria menu looks good.
- focus styling, having a few pixels out of border line will be researched later.
Thanks for all your work @smhigley !
@shirsha I noticed that when the screen reader announced "signup sample content" the focus was already in content section, not in the "sign up" sublink. |
I have finished making editorial changes for consistency. I have also fixed the title of and links to the other disclosure navigation menu example. There is one part of the text that I'm still not satisfied is sufficiently clear. It is related to high contrast mode documentation. It is:
It really doesn't yet explain why this is choice of coding technique matters. Compare to what we have written in the navigation menu bar for similar HCM support.
This text from the navigation menubar explains the feature, why it matters, and why the technique for achieving it was chosen. Could someone suggest wording that achieves these same objectives for the HCM documentation for this example? |
This is all ready to merge except that I would still like some assistance improving the high contrast documentation in accessibility features as described in my previous comment. Could someone help me understand the rationale for choice of the after pseudo border style and what distinguishes that technique from others when it comes to HCM support? |
…er agreement in March 2 meeting
Per discussion in March 2, 2021 meeting, I removed:
Conducting a final read and will merge. |
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 approving editorial review.
Love this addition! Thank you @smhigley!
…3c#1614) * Adds another version of the mythical university navigation that includes links for the top-level pages. * Satisfies one of the steps in the plan for improving navigation patterns described in issue w3c#89. Co-authored-by: Matt King <[email protected]>
…3c#1614) * Adds another version of the mythical university navigation that includes links for the top-level pages. * Satisfies one of the steps in the plan for improving navigation patterns described in issue w3c#89. Co-authored-by: Matt King <[email protected]>
Adds a new disclosure menu example page with top-level links in addition to disclosures, based on the 10/27 APG meeting. Related to #89. Also updates the disclosure nav js file to use a class pattern based on the updated code style guide.
Preview Link
Review checklist
Preview | Diff