-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: Make Flyout an ARIA list (experimental)
#9528
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
feat: Make Flyout an ARIA list (experimental)
#9528
Conversation
Addresses some observed gaps in behaviors with connections. This is unfortunately mainly a patch without fully understanding the deep issue being avoided but it seems reasonable for the experimental branch.
…ode-hierarchy Conflicts: core/block_svg.ts
It seems that the extra safety checks weren't actually needed.
More investigation and fixes are likely still needed.
…ode-hierarchy Conflicts: core/block_svg.ts
Conflicts: core/block_svg.ts
|
@microbit-robert does this work for micro:bit? Will get this into review if you don't see any issues (and after #9449 goes in). It seems to be working well for me in ChromeVox and @gonfunko tested it on VoiceOver and didn't spot any issues so I'm hoping this addresses the root problem. |
Only one behavioral change was needed.
Fixes ARIA ownership for these connection types.
|
I have the following issue on Chrome, Firefox and Safari:
In Safari and Firefox, the changes work well and the flyout navigation seems good. I get some very odd VoiceOver issues when testing these changes on Chrome only.
I reset my VoiceOver settings to the defaults. I'll be even more confused if these issues can't be reproduced by anyone else - specifically the Chrome only issue. An alternative approach that does seem to work in Chrome, Firefox and Safari is to replace menu and menuitem with listbox and listitem. Screen recording using VoiceOver and Chrome: I'll try and track down what changes specifically affect things in VoiceOver - comment has been updated. |
|
@microbit-robert I can repro the Safari issue, but the Chrome/VoiceOver one works fine for me even with the same block layout and key sequence as shown in your demo video oddly enough. |
core/flyout_base.ts
Outdated
| // TODO: Optimize this. | ||
| return this.normalizeSeparators(contents).map((item) => { | ||
| // aria.setRole(item.getElement().getFocusableElement(), aria.Role.MENUITEM); | ||
| return item; | ||
| }); |
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 appears to be a no-op at present, remove or uncomment the role setting?
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.
Uh, this was a placeholder for testing and I did forget to remove it. Thanks for calling it out!
core/block_svg.ts
Outdated
| if ( | ||
| nextConnection && | ||
| nextConnection.canBeFocused() && | ||
| nextConnection.type === ConnectionType.NEXT_STATEMENT |
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 think the check for type === ConnectionType.NEXT_STATEMENT is redundant given that we got the connection from the nextConnection field?
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.
Good point--will remove this.
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.
Also, moving comment to #9449 where it's actually needed.
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.
Addressed in #9449.
|
Thanks @microbit-robert! That is very puzzling. I'm not opposed to switching to |
This is an issue with #9449 and is actually rather concerning. I wasn't expecting the |
|
I was semi expecting the hierarchy changes from #9449 to cause more stability in the flyout for this PR but that may not actually be the case. I will try to decouple those changes so that this can go in independently as this is a much more pressing problem for the user test than #9449 (which is really just a stabilizing PR despite the regression). |
Flyout an ARIA menu (experimental) [Blocked: #9449]Flyout an ARIA menu (experimental)
BenHenning
left a comment
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.
Quick self-review after detaching #9449.
Technically the branch name is now a lie.
Flyout an ARIA menu (experimental)Flyout an ARIA list (experimental)
BenHenning
left a comment
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.
Self-reviewed commit that changes this to a list (and makes the branch name a liar :) ).
|
@gonfunko could you perhaps take one more quick pass on the PR now that #9449 is detached and there are some other changes here? @microbit-robert is this working well enough to merge or are more changes needed? I can do those on Monday if so. |
|
@BenHenning This now works well for me, thanks! There is some interesting numbering going on in VoiceOver with the list items in the flyout for full block fields that exist on their own (i.e., the first block in the Math flyout), but I think this is something that could be looked at separately. I would be happy if this got merged as is. |
Could you file an issue for that separately @microbit-robert? Would be helpful to look at with a bit more context. |
bb342f9
into
RaspberryPiFoundation:add-screen-reader-support-experimental
The basics
The details
Resolves
Fixes #9495
Proposed Changes
Changes a bunch of ARIA role & label management to ensure that
Flyoutacts like a list rather than a tree.Reason for Changes
Flyouts are always hierarchically flat so it doesn't make sense to model them as a tree. Instead, a menu is likely a better fit per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/menu_role:However, there are important caveats that need to be considered and addressed:
listandlistitems as a slightly more generic enumerating alternative for menus.menuitems cannot contain interactive elements (they are expected to be interactive themselves). This has led to a few specific changes:menuitemrather than their container parent, and they no longer use the role button.listitem(or a few more specific alternatives) both blocks and buttons lack some context. Since not allFlyoutitems can be expected to be interactive, buttons and blocks have both had their labels updated to include an explicit indicator that they are buttons and blocks, respectively. Note that this does possibly go against convention for buttons in particular but it seems fine since this is an unusual (but seemingly correct) utilization of alistelement.Flyoutis now its verbose label rather than the more compact form.* This is largely a consequence of a few specific attributes of
menuitemandmenus as a whole and very likely also applies totrees andtreeitems (andlists andlistitemss). However, now seemed like a good time to fix this especially in case some screen readers get confused rather than ignore nested interactive controls/follow semantic cloaking per the spec.Demo of it working on VoiceOver (per @gonfunko -- note this was the
menuvariant rather than thelistvariant of the PR):Test Coverage
This has been manually tested with ChromeVox. No automated tests are needed as part of this experimental change.
Documentation
No new documentation changes are needed for this experimental change.
Additional Information
None.