-
Notifications
You must be signed in to change notification settings - Fork 333
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
1028 disclosure menu example #1036
1028 disclosure menu example #1036
Conversation
Hi, @smhigley ! Here's the preview link I used: https://raw.githack.com/smhigley/aria-practices/1028-disclosure-menu-example/examples/disclosure/disclosure-navigation.html I only have one editorial comment:
I also have one visual design consideration/discussion point: Even though I know this pattern does not support arrow keys within the dropdown lists, I somehow expected arrow keys to navigate within the dropdown, so I was momentarily confused; whereas for some reason, I didn't try using arrow keys inside the dropdowns on usa.gov. There must be subtle visual cues that can cause a user to lean towards tabbing or trying arrow keys. Looking at the visual cues on both sites:
I'm not sure which of those gives the strongest cue, or maybe it's a combination, but I think the example maybe looks a bit too much like a menubar? It might be helpful to make it look more "link-ish" so that sighted keyboard users think "tab key"? Do you agree? It would be useful to know if anyone else felt this way, or if it was just me. |
@carmacleod I actually felt the same way! I didn't implement arrow keys within the dropdowns because the usa.gov reference didn't use them (and because it's not a real I think maybe to give the best visual cue to tab into dropdown menus, I could:
Do you think implementing the above would fix the arrow key confusion? I'm also not opposed to adding arrow key functionality (in addition to tabs) to the dropdowns if desired. |
Phew! I hoped it wasn't just me. :)
I think those changes would help a lot. :)
While adding arrow key behavior would help sighted keyboard users (because they could choose to use arrows or tabs), it wouldn't make any difference to AT users because arrow keys are used for AT navigation. This seems like something that should be discussed with the group, i.e. do we want to promote improved arrow key behavior for sighted keyboarders but not AT users? Maybe that's ok? What is interesting is that arrow key and home/end behavior are listed as optional in the accordion pattern, so I guess this type of thing has been discussed and allowed before. It would be great to have a link to that discussion. I quickly tested the accordion example and this disclosure menu example in NVDA/Chrome, and I can confirm that arrow keys work very differently depending on whether or not NVDA is running. |
I think "improved" is a relative term. Arrow keys work to scroll the viewport (or container if it is a scrolling container). Adding support for arrow keys to the menu removes native support for scrolling when in the navigation menu. Since there is no obvious indication (instructions or otherwise) that native features are removed, I suggest against adding keyboard support for this example. Testing with users can provide more insight, though as a consultant I would caution clients against implementing them without testing with their users. And exposing that change to users in text. |
Excellent points, @aardrian. If we do discuss it and decide to go ahead, we should make sure the behavior is listed as "(Optional)". |
Yes and yes. Providing a qualifier is good, and a general note about default keys for browsers and maybe AT would be useful. It may be unnecessary to list them, but at least acknowledge that there are default behaviors in different contexts and programmatically assigning keys can blow it up for users. Good idea. Now I am wondering if it is worth mentioning_events_ as well. For example an event triggered by Space fires |
@aardrian / @carmacleod good points, thanks for the feedback! @aardrian you aren't the only person to have mentioned that hijacking the default scroll functionality of arrow keys might cause confusion, so it's definitely on my mind :). I know this isn't common for aria practices examples, but what if I included something like a checkbox for "include arrow key navigation" to the example, to display both possible behaviors? Then the "Accessibility Features" section can include a mention of the potential benefits and drawbacks of adding arrow key navigation, and it can be listed as optional in the "Keyboard Support" table. Right now, the notes I'd like to see are:
What do you think, and is there anything else to add? Right now I'm leaning towards implementing arrow keys + home/end for both the top-level buttons and dropdown links with the added caveats. I'm even more in favor of adding the "yes/no arrow keys" switch to demonstrate both options. |
Not common is no reason not to, IMO. If anything you have made the case to make it more common. I like your notes. To me they are clear with one tweak:
Yeah? Decent? Over-simplified I know.
I like that as it does not split the pattern. BTW, what do you think of the pattern where the top-level item is a link, with the disclosure control as a peer? I ask because I have built a similar nav menu that does it. I have had clients ask for top-level-as-link and top-level-as-control-only for a couple decades (roughly), so I have a pattern I can share (in a different thread to not pollute this PR). |
Right - I hadn't thought of that. Your knowledge of "user gotchas" is appreciated. @smhigley I like the checkbox idea. You could try it as long as you don't mind ripping the code out if the group prefers to keep it simple. You might want to commit the other stuff first (or make a new branch) so that you can back things out easily... :) |
@aardrian - just saw your latest comment
Sounds interesting. Please do share, so we can compare how it "feels". (Perhaps it would even warrant another checkbox 😄 ). |
@carmacleod @smhigley, |
Oh wow, I had the same feeling of "I should be able to use arrow keys here" that I had with this issue's example. I guess I expect links to look... "linkier", with some kind of underline affordance - even if it's only on focus or hover. It makes me feel like I'm tabbing twice for every menuitem... even though I know that it's a link and a button, and not a menuitem. I must have a "menubar mindset" (carried over from the desktop days). |
No. Most of my clients were not interested in 2.5.5 as it is AAA and they felt made it look to blocky. A larger hit area outside of the border is just a Fitts failure. For an example here, that is an easy change. |
Thanks for the reminder - I was thinking it was AA.
I had to look up Fitts Law - I haven't thought about it in a long time. I wonder if there's a bit of wiggle room - I'd have to do the math.
Absolutely! |
@smhigley, if you're interested, I remembered I had a pagination demo page I was doing some testing on (but never finished), and one of the features as a control to turn on arrow key navigation: I like your idea of a checkbox (switch?) better though :) |
@carmacleod / @aardrian / @scottaohara sorry this took a while to update, but the arrow key checkbox and extra wording has been added. Let me know what you think! (link: https://raw.githack.com/smhigley/aria-practices/1028-disclosure-menu-example/examples/disclosure/disclosure-navigation.html) |
@smhigley That plays very well, and it's clear now that the menuitems are links - nice! Teeny-tiny bug in the arrow key version:
|
@smhigley Wow, you even added tests - very cool! |
Only thing i noticed was the weird bit of page scroll as @carmacleod mentioned when testing this with macOS safari/chrome/firefox Space/enter both worked for me, and i noticed that down arrow went into the sub-list when the button was in the expanded state. that makes sense to me cause these aren't |
@carmacleod thanks, I missed that one! Pushing up the fix now :). @scottaohara yup, I coded it to have down arrow move into the menu from the button only after it was already opened. Definitely open to suggestion though :) |
Based on feedback in the ARIA APG meeting, I'm going to implement a small fake page content section below the menu, and point each link to its idref, then dynamically change the title of the fake page content based on the activated link. I'll also add a bullet under "accessibility features" that specifies that escape is necessary because of the 2.1 content on hover or focus guideline that specifies popup content should be dismissable. |
@smhigley Thanks for all your work. This is great. I also love the option of the arrow key navigation! For the sake of "consistent" APG example documentation - APG group spent quite some time to figure out this format of APG example template - the heading for the example page can be "Disclosure Navigation Menu Example" or something rather than "Example Disclosure (Show/Hide) for Navigation Menu" Please refer other APG example headings if needed. APG is looking forward to pushing your example to the issue branch! |
@a11ydoer in this case, would it be better to follow the format of headings from other examples like menubar or grid, or from the other disclosure examples? I ran into this when initially creating the page, since the other two disclosure examples seem a little different from the rest. |
@smhigley , this is great. Do not apologize for what you think is a delay as this is moving at a comparatively quick pace. I see In a vacuum, I would be inclined to exclude it just to keep the scope of this menu pattern as tight as possible. |
I agree with Adrian re excluding the separator. There are example separators in the menubar pattern example, so not needed here. |
@aardrian / @carmacleod it was 100% a holdover from a different pattern. I kept it originally for parity, then forgot about it when I re-styled 😆 |
e1618af
to
9e68018
Compare
Changes are up, ready to be re-reviewed! They include:
|
Very nice! It feels intuitive and "linky", and still works well with mouse. A few editorial comments:
|
@carmacleod thanks for reviewing the documentation! I removed the wording around the down icon changing with I also made the wording changes you recommended for using/used and tabbing, and updated the wording about the down icon and high contrast mode to reflect the actual implementation :). Thanks again! |
One more suggestion from @mcking65 to remove references to the word "menu". |
Just a quick note that there's still one remaining instance of the |
@smhigley, I couldn't push to your fork so merging to a feature branch. Whenever you get a chance, please create a fresh PR from the issue1028-disclosure-menu-example branch. I'll just be making a few minor editorial changes. The only thing I see in this PR that I don't understand are the changes to package.json. They don't look like changes generated by NPM. |
PR is continued here: #1070 |
Resolves #1028, adds a site navigation example using the disclosure pattern similar to the main menu of https://www.usa.gov/.
Could use some help reviewing the documentation in particular. Thanks! :)
Preview | Diff