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

docs(ui-focusable): make screenreader annouce Tooltip in Focusable ex… #1870

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ToMESSKa
Copy link
Contributor

@ToMESSKa ToMESSKa commented Feb 13, 2025

…ample by providing aria props

INSTUI-4313

ISSUE:
In Focusable, there is a tooltip called "I'm Focused!", but no hint is provided for screen reader users about its presence.

TEST PLAN:

  • navigate to the first example in Focusable using different screen readers
  • screen readers should announce both the button text and the tooltip text.
  • inspect the HTML code to verify that the elements are correctly associated using aria-labelledby and id attributes

@ToMESSKa ToMESSKa self-assigned this Feb 13, 2025
Copy link

github-actions bot commented Feb 13, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://instructure.github.io/instructure-ui/pr-preview/pr-1870/

Built to branch gh-pages at 2025-02-14 15:27 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@@ -15,7 +15,7 @@ type: example
console.log(options)
return <span>
<div>
<Button>Focus me!</Button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is no need to associate the button with itself. Just the tooltip is enough:
<Button aria-labelledby="tooltip">Focus me!</Button> Also I suggest to give a more unique ID to items in examples (e.g. focusable-example1-tooltip, who knows that else could use this ID in the docs app

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matyasf I associated the button with itself because otherwise, the button's title would not be announced—only the "tooltip" text would be.
(The first example in Tooltip works similarly; the tooltip text is read after the button's title.)

@ToMESSKa ToMESSKa force-pushed the INSTUI-4313_ensure_custom_controls_provide_proper_textual_name_role_and_state_information branch from 66ec22c to a3cb401 Compare February 14, 2025 15:08
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.

2 participants