+
Skip to content

Conversation

anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented Sep 3, 2024

Summary

An aria-label can be used to set what a screen reader uses for a heading element, even when the heading element doesn't have content available in its "a11y tree" (e.g. children nodes of the element). There is one exception where a heading tag can have both aria-label and aria-hidden, which also removes it from the "a11y tree".

The logic introduced in this PR reflects the above.

Test Plan

I've updated the snapshots to reflect what should be a valid and invaild use of aria-label.

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Sep 3, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just taking the opportunity to remove whitespaces I left in my other fix lines. 😄

Copy link

codspeed-hq bot commented Sep 3, 2024

CodSpeed Performance Report

Merging #3767 will not alter performance

Comparing anthonyshew:shew-08f3d (d9eb234) with main (35e9e6d)

Summary

✅ 99 untouched benchmarks

Copy link
Member

@Conaclos Conaclos left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@Conaclos Conaclos merged commit e1e6de7 into biomejs:main Sep 4, 2024
@anthonyshew anthonyshew changed the title fix: let aria-label be valid for useHeadingContent. fix: let aria-label be valid for useHeadingContent. Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Changelog Area: changelog A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载