Skip to content

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

Merged
ToMESSKa merged 1 commit intomasterfrom
INSTUI-4313_ensure_custom_controls_provide_proper_textual_name_role_and_state_information
Feb 21, 2025
Merged

docs(ui-focusable): make screenreader annouce Tooltip in Focusable ex…#1870
ToMESSKa merged 1 commit intomasterfrom
INSTUI-4313_ensure_custom_controls_provide_proper_textual_name_role_and_state_information

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
@github-actions
Copy link

github-actions bot commented Feb 13, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-02-21 12:37 UTC

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
@ToMESSKa ToMESSKa requested a review from matyasf February 19, 2025 15:58
Copy link
Contributor

@joyenjoyer joyenjoyer left a comment

Choose a reason for hiding this comment

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

nice work

@ToMESSKa ToMESSKa merged commit e38bce2 into master Feb 21, 2025
11 checks passed
@ToMESSKa ToMESSKa deleted the INSTUI-4313_ensure_custom_controls_provide_proper_textual_name_role_and_state_information branch February 21, 2025 12:36
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.

3 participants