Skip to content
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

fix(tooltip): an attempt at fixing aria-describedby #6918

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

olaf-k
Copy link
Contributor

@olaf-k olaf-k commented Feb 29, 2024

Pull Request

πŸ“– Description

This is an attempt at fixing the following:

  1. updating the anchor's aria-describedby even when the attribute does not exist in the first place
  2. updating the anchor's aria-describedby when the tooltip is disconnected
  3. removing event handlers when the tooltip is disconnected
  4. making screen readers pick up aria-describedby

🎫 Issues

4 is a fix for #6442

πŸ‘©β€πŸ’» Reviewer Notes

1 to 3 are straightforward and should not pose any issue hopefully.

to "solve" 4, moving aria-describedby to the custom element itself and adding role="button" seems to make the tooltip's text content picked up by screen readers.

Caveat:

  • [minor] NVDA will indeed read the tooltip's content but will say "button" twice.
  • [more annoying] VoiceOver picks up the tooltip's content but... hides it behind a unnecessarily complex UI:
Screenshot 2024-02-29 at 12 13 38

once you press Control-Option-Command-Slash as instructed, you are presented with a list of additional data:
Screenshot 2024-02-29 at 12 14 38

there is a Safari ticket that discusses the issue but nothing Fast can do at this point: it is a VO limitation.

βœ… Checklist

General

  • I have included a change request file using $ yarn change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

@@ -10,6 +10,7 @@ export function buttonTemplate<T extends FASTButton>(
options: ButtonOptions = {}
): ElementViewTemplate<T> {
return html<T>`
<template role="button" aria-describedby="${x => x.ariaDescribedby}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will have much more wide ranging effects when fixing this. If the proposal is to do this, which is certainly one thing which could be done, I would suggest a wholesale move to remove the internal button.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about doing that but found it too extreme.
having a button inside a role="button" is not great though, I agree. what other "wide ranging effects" are you thinking of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants