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

Update a11y.ts #9507

Closed
wants to merge 7 commits into from
Closed

Update a11y.ts #9507

wants to merge 7 commits into from

Conversation

OliverSpeir
Copy link
Contributor

Allow for aria-label and aria-labelledby in a11y-missing-content rule

Changes

Testing

unfamiliar with testing honestly, sorry in advance

Docs

docs update unnecessary

Update a11y-missing-content rule
Copy link

changeset-bot bot commented Dec 23, 2023

⚠️ No Changeset found

Latest commit: e346b55

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 23, 2023
@matthewp matthewp added the needs response Issue needs response from OP label Dec 27, 2023
@OliverSpeir
Copy link
Contributor Author

After researching deeper to answer the question about aria-describedby I realized that if a heading or anchor has an img inside it and that img has an alt property then that alt will become the "accessible name".

I also realized that previously it was only going to check if the element that the aria-labelledby property referenced existed, but what it really should be checking if any one of the IDs have valid text

I did test this by editing my node_modules on a local repo fwiw but if someone can verify it all works that would probably be best 😅

more reference: https://www.w3.org/TR/accname/#dfn-accessible-name

@Princesseuh Princesseuh removed the needs response Issue needs response from OP label Dec 29, 2023
add svg title check, as well as verified this rule aligns with deque and with voiceover 

formatted and fix a little ts issue as well
instead of using .some() method for the arialabelledby checks use a for loop just like the other checks
@OliverSpeir
Copy link
Contributor Author

Tried to improve readability, as well as return early as @fflaten suggested.

Also changed the error message.

@OliverSpeir OliverSpeir closed this by deleting the head repository Jan 2, 2024
@OliverSpeir OliverSpeir mentioned this pull request Jan 2, 2024
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants