Opened 5 years ago
Last modified 2 months ago
#49950 assigned defect (bug)
Twenty Twenty: with horizontal menu, submenu should be dismissible
Reported by: | lcarevic | Owned by: | joedolson |
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch changes-requested |
Focuses: | accessibility, javascript | Cc: |
Description
Hi there!
I've tried adding a submenu in the horizontal menu but there is some issue regarding accessibility when I tested it.
It fails the Success Criterion 1.4.13 Content on Hover or Focus of WCAG : https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus
The submenu cannot be dismissed. If there are many links in the submenu, keyboard navigation is tedious since the person will have to tab all of the content of the submenu before reaching the next item of the menu.
Expected fix:
The submenu should be dismissable with the Esc key for example.
Here is a menu with a submenu that implements the SC 1.4.13 : https://www.eesc.europa.eu/
It's my first ticket, so I hope I'v done it properly.
Regards,
Luce
Attachments (2)
Change History (42)
#2
@
5 years ago
- Keywords needs-testing needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Version 5.4 deleted
#3
@
10 months ago
- Keywords has-patch added; needs-patch removed
Patch added. Need Testing. Style.css, Style-rtl.css and index.js files updated. Tabbing will open a sub-menu and the user can go through it. If the user presses the ESC key while the sub-menu is opened, it will close the submenu and the user can move to the next menu item.
This ticket was mentioned in Slack in #accessibility by rcreators. View the logs.
10 months ago
This ticket was mentioned in PR #6150 on WordPress/wordpress-develop by @rcreators.
10 months ago
#5
abbing will open a sub-menu and the user can go through it. If the user presses the ESC key while the sub-menu is opened, it will close the submenu and the user can move to the next menu item. Also updated index.js as per slack discussion to make parent a focus when closing sub menu with esc.
Trac ticket: https://core.trac.wordpress.org/ticket/49950
#7
@
10 months ago
- Milestone changed from Future Release to 6.6
Thanks, @rcreators! I think it's too late in the 6.5 cycle to add this in, but I'm going to slate it for 6.6, and plan on getting it in early.
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
9 months ago
This ticket was mentioned in Slack in #accessibility by rcreators. View the logs.
8 months ago
#11
@
8 months ago
- Summary changed from Twenty Twenty (1.2) Horizontal menu - Submenu to Twenty Twenty: with horizontal menu, submenu should be dismissible
#12
@
7 months ago
- Keywords changes-requested needs-refresh added
Hi @rcreators
I tested PR 6150 using Chrome on macOS, and the update breaks the menu.
When I navigate to the menu using the tab key, the visible focus is on the first parent menu item, and the submenu shows.
Pressing tab again, I am expecting to be able to use the submenu, but the submenu is no longer visible, and I can't see where the focus is.
I can only use the escape key once to close a submenu.
When I navigate to the menu using the tab key, the visible focus is on the first parent menu item, and the submenu shows.
When I press escape, the submenu no longer shows.
if I tab forwards from there, the visible focus os on parent menu item two, and its submenu shows.
When I press escape, nothing happens.
If I navigate with they keyboard past the menu and navigate backwards with Shift + Tab, focus moves to the wrong element. It moves to the parent menu item, not the the last item in the submenu.
#13
@
7 months ago
I tested this as well, but I don't see quite the same experience as @poena
Pressing tab again, I am expecting to be able to use the submenu, but the submenu is no longer visible, and I can't see where the focus is.
1) I can't replicate this issue.
I can only use the escape key once to close a submenu.
2) I replicated this issue.
If I navigate with they keyboard past the menu and navigate backwards with Shift + Tab, focus moves to the wrong element. It moves to the parent menu item, not the the last item in the submenu.
3) In my opinion, this change is an improvement, since it allows the navigation of the menu to be sped up both forward and backwards. However, if it's not a necessary change, it could be eliminated. I'm not sure the toggling of visibility is actually necessary to this change.
I also found an additional issue - the menu no longer closes when the link loses focus by means *other* than a keypress. E.g., if you tab onto the parent menu then click on the page, the menu stays open. A loss of focus by click should also be considered intent to close the menu.
#14
@
7 months ago
- Keywords changes-requested needs-refresh removed
Hello @joedolson and @poena,
So I found the issue that @poena talked about. It happens when there is a multi-level sub-menu. I adjusted the code to make it work in that situation as well.
Apart from that, if you move back with the shift + Tab, as the sub-menu is already out of focus, it will focus on the parent menu item and then you can move to the sub-menu item with tabbing. Let me know if you want to change that function. It can be just updated with visibility CSS.
I also added a focusout event for the menu. So if the user clicks or does any event outside of the menu, the sub-menu will close down as well.
Please test this out and let me know if any further changes are required.
This ticket was mentioned in Slack in #accessibility by rcreators. View the logs.
7 months ago
#16
@
7 months ago
Even though I actually think it's an improvement, I actually am inclined to think that we should not have reverse tabbing skip the submenus. On older core themes, we generally try only to fix bugs, and not actually make changes to behavior beyond that, which this would be.
@poena, if you have an opinion on this, let us know.
This ticket was mentioned in Slack in #accessibility by rcreators. View the logs.
7 months ago
#18
@
7 months ago
- Keywords close added
My recommendation would be to move this to close due to the reversing. I am going to gently propose this with the keyword but we can always revisit. I would love to have feedback from @poena and others that might counter this.
#19
@
7 months ago
- Keywords close removed
@karmatosed I'm not following your reasoning for closing this ticket. The reverse tabbing is not a change we should make in this ticket, but that doesn't have any relationship to the need to be able to close submenus using the esc
key. My argument is that we should limit the scope of the patch to the reported issue, and not make other unneeded interface changes at the same time.
#20
@
7 months ago
Apologies @joedolson I misunderstood. Thank you for course correcting. This is another good reason we have that keyword and let things sit for a bit, so this can be checked, thanks for doing that.
#21
@
7 months ago
@joedolson and @poena Reverse Tabbing to the sub-menu is amended and working fine with the rest of the functionality. Please test and confirm. It is ready to commit.
This ticket was mentioned in Slack in #accessibility by rcreators. View the logs.
7 months ago
This ticket was mentioned in Slack in #accessibility by rcreators. View the logs.
6 months ago
This ticket was mentioned in Slack in #accessibility by sabernhardt. View the logs.
6 months ago
This ticket was mentioned in Slack in #core-themes by karmatosed. View the logs.
5 months ago
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
4 months ago
This ticket was mentioned in Slack in #core-themes by poena. View the logs.
3 months ago
#31
@
3 months ago
Is anyone able to clarify what changes are still requested? So that this can be addressed.
#32
@
3 months ago
The changes requested are fairly clearly laid out in the PR; are you asking me to repeat them here, @poena?
See: https://github.com/WordPress/wordpress-develop/pull/6150
#33
@
3 months ago
@joedolson No, I did not see the comments since they are not copied from GitHub to Trac, explaining where the requests are is enough.
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
2 months ago
This ticket was mentioned in Slack in #core by chaion07. View the logs.
2 months ago
#36
@
2 months ago
Thanks @lcarevic for reporting this. We reviewed this Ticket during a recent bug-scrub session. Here's a summary of the feedback received:
- There is a new commit on PR that marks the requested changes as outdated
- Considering the possibility of moving this Ticket to the next milestone in case it doesn't get closed
Thank you.
Props to @pratiklondhe for these suggestions.
Cheers!
Updated CSS file and JS file code. Keyboard tabbing will open submenu and esc will close submenu as per accessibility standard.