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

Support controlling Tooltip's association prop via <IconButton /> #1457

Closed
schne324 opened this issue Apr 19, 2024 · 1 comment · Fixed by #1465
Closed

Support controlling Tooltip's association prop via <IconButton /> #1457

schne324 opened this issue Apr 19, 2024 · 1 comment · Fixed by #1465
Milestone

Comments

@schne324
Copy link
Member

In cases where the icon button needs a complex accessible name joined from several tokens in the aria-labelledby attribute, it can be difficult to create the "ideal" accessible name. Specifically the fact that the tooltip's ID gets added to the end of the token list can create some sub-optimal accNames.

Example

<h2 id="heading">Some contextual heading</h2>
<p id="paragraph">additional info</p>
<IconButton
  icon="foo"
  label={i18n`Some action`}
  aria-labelledby={`heading paragraph`}
  onClick={handleInspect}
/>

This would create an accessible name of:

Some contextual heading additional info Some action

Where it is sometimes ideal for "Some action" to be at the beginning of the accName

@scurker scurker added this to the Q2 2024 milestone Apr 19, 2024
@scurker
Copy link
Member

scurker commented Apr 19, 2024

So I think we can address some of this holistically with #1423, but in the interim period we need to find some middle ground.

I think the changes to be made here are:

  • Add tooltipProps to IconButton
  • Merge any of the existing individual tooltip props with properties from tooltipProps taking priority
  • Mark the existing individual props as deprecated

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