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

feat(a11y): add aria-labels to various buttons #890

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xyhhx
Copy link

@xyhhx xyhhx commented Feb 11, 2024

Affects #472

Copy link
Member

@peterthomassen peterthomassen left a comment

Choose a reason for hiding this comment

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

This is good stuff, thanks!

Overall, I was wondering whether it's possible to reduce the duplication, by somehow telling it that aria-label should have the same value as the element's inner text node. Is that possible? And if so, does it make sense to do it?

www/webapp/src/views/CrudList.vue Outdated Show resolved Hide resolved
www/webapp/src/App.vue Outdated Show resolved Hide resolved
www/webapp/src/views/CrudList.vue Outdated Show resolved Hide resolved
www/webapp/src/views/DomainSetup.vue Outdated Show resolved Hide resolved
www/webapp/src/views/DomainSetup.vue Outdated Show resolved Hide resolved
@xyhhx xyhhx force-pushed the feature/add-aria-labels-to-btns branch from 5a77565 to 36d2697 Compare March 26, 2024 19:54
@xyhhx
Copy link
Author

xyhhx commented Mar 26, 2024

Overall, I was wondering whether it's possible to reduce the duplication, by somehow telling it that aria-label should have the same value as the element's inner text node. Is that possible? And if so, does it make sense to do it?

Good idea. I'm not sure if it's possible, I can look around; but I do think that at least for some places it does make sense!

@xyhhx
Copy link
Author

xyhhx commented Mar 27, 2024

This is good stuff, thanks!

Overall, I was wondering whether it's possible to reduce the duplication, by somehow telling it that aria-label should have the same value as the element's inner text node. Is that possible? And if so, does it make sense to do it?

Looking more into this, I'm not even sure every button needs aria-label.

According to MDN aria-label is for when the accessible name isn't available or is inaccurate:

Sometimes the default accessible name of an element is missing, or does not accurately describe its contents, and there is no content visible in the DOM that can be associated with the object to give it meaning.

According to the W3C, the accessible name can be automatically derived from the visible text of a button/link/etc:

The value of the accessible name may be derived from a visible (e.g., the visible text on a button) or invisible (e.g., the text alternative that describes an icon) property of the user interface element

So maybe I should review this PR and actually remove any occurrences where the aria-label I've provided is the exact match of the elements' values

@peterthomassen
Copy link
Member

So maybe I should review this PR and actually remove any occurrences where the aria-label I've provided is the exact match of the elements' values

Yes, I think so!

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.

2 participants