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

fix(a11y): Fix some audit false positives #9483

Merged
merged 6 commits into from
Dec 20, 2023
Merged

Conversation

Princesseuh
Copy link
Member

Changes

Some small false positives. Additionally rewrote a message to have the same form as the other messages.

Fix #9456
Fix #9422

Testing

Tested manually!

Docs

N/A

Copy link

changeset-bot bot commented Dec 19, 2023

🦋 Changeset detected

Latest commit: 4860291

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

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 github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 19, 2023
Copy link
Contributor

github-actions bot commented Dec 19, 2023

⚖️ Bundle Size Check

Latest commit: 4860291

File Old Size New Size Change
dev-overlay/plugins/audit/a11y 11.04 KB 11.21 KB + 164 B

@github-actions github-actions bot added the pr: docs A PR that includes documentation for review label Dec 19, 2023
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Changes look mostly good, just one question on implementation

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Updated label audit makes sense to me! Left a couple of small comments, but LGTM 🙌

const inputChild = element.querySelector('input');
if (!inputChild?.textContent) return true;
// Label must be associated with a control
const hasFor = element.hasAttribute('for');
Copy link
Member

Choose a reason for hiding this comment

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

Should we also be checking that the for attribute element actually exists? Or does another audit take care of that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure I understand what you mean. The line you highlighted checks for for?

Copy link
Member Author

@Princesseuh Princesseuh Dec 20, 2023

Choose a reason for hiding this comment

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

Oh, I just got it, that the element the for is for exists, that's neat. We could do another rule for that, this rule is already a bit overloaded! I'll add it to the backlog.

@Princesseuh Princesseuh merged commit c384f69 into main Dec 20, 2023
14 checks passed
@Princesseuh Princesseuh deleted the fix/a11y-false-positive branch December 20, 2023 15:25
@astrobot-houston astrobot-houston mentioned this pull request Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review
Projects
None yet
3 participants