Skip to content

fix(Tooltip): aria-describedby and aria-labelledby#4202

Merged
Barsnes merged 8 commits intomainfrom
tooltip/describedby
Nov 4, 2025
Merged

fix(Tooltip): aria-describedby and aria-labelledby#4202
Barsnes merged 8 commits intomainfrom
tooltip/describedby

Conversation

@Barsnes
Copy link
Member

@Barsnes Barsnes commented Nov 3, 2025

Summary

Checks

@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

🦋 Changeset detected

Latest commit: c3fa3ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@digdir/designsystemet-react Patch
@digdir/designsystemet Patch
@digdir/designsystemet-css Patch
@digdir/designsystemet-theme Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Preview deployments for this pull request:

storybook - 4. Nov 2025 - 09:31

@oddvernes
Copy link
Collaborator

  • Should we have aria-hidden on the tooltip like primer (if we can find out why exactly)
  • should we do as mattilsynet and automatically use aria-labelledby if there is no text in the wrapped element and aria-describedy if there is text
  • is role=tooltip needed or not, looks like mattilsynet does not have it and @eirikbacker mentioned it is poorly supported

@Barsnes
Copy link
Member Author

Barsnes commented Nov 3, 2025

  • Should we have aria-hidden on the tooltip like primer (if we can find out why exactly)
  • should we do as mattilsynet and automatically use aria-labelledby if there is no text in the wrapped element and aria-describedy if there is text
  • is role=tooltip needed or not, looks like mattilsynet does not have it and @eirikbacker mentioned it is poorly supported

We have role="tooltip" since it is mentioned here https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/#:~:text=or%20the%20tooltip.-,WAI%2DARIA%20Roles%2C%20States%2C%20and%20Properties,-The%20element%20that
We don't have aria-describedby, so we should at least have that

@Barsnes Barsnes changed the title fix(Tooltip): aria-describedby fix(Tooltip): aria-describedby and aria-labelledby Nov 3, 2025
Copy link
Contributor

@eirikbacker eirikbacker left a comment

Choose a reason for hiding this comment

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

Bare forslag til tweaks på struktur, og en 'id' som nok ikke skulle være en fast string :)

@Barsnes Barsnes marked this pull request as ready for review November 4, 2025 08:36
Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

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

LGTM!

@Barsnes Barsnes merged commit 813d65f into main Nov 4, 2025
18 checks passed
@Barsnes Barsnes deleted the tooltip/describedby branch November 4, 2025 13:41
@github-actions github-actions bot mentioned this pull request Nov 4, 2025
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