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

Match visible text with aria-labels #1906

Merged
merged 1 commit into from Jun 27, 2023

Conversation

Fenn-CS
Copy link
Contributor

@Fenn-CS Fenn-CS commented Jun 25, 2023

When the visible button label does not match the aria-label button activation via voice input cannot be guaranteed.

Resolves : http://local.nextcloud.test/index.php/apps/photos/

@Fenn-CS Fenn-CS force-pushed the 1675-correct-aria-label-on-create-album-button branch from d29eb49 to c99fab2 Compare June 25, 2023 21:24
@Fenn-CS
Copy link
Contributor Author

Fenn-CS commented Jun 26, 2023

/compile amend

When the visible button label does not match the aria-label button
activation via voice input cannot be guaranteed.

Resolves : #1675

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@nextcloud-command nextcloud-command force-pushed the 1675-correct-aria-label-on-create-album-button branch from c99fab2 to faa2dd0 Compare June 26, 2023 17:16
@Fenn-CS Fenn-CS requested a review from susnux June 26, 2023 22:00
@susnux
Copy link
Contributor

susnux commented Jun 27, 2023

LGTM but if aria labels and button text should match, then we recommending something wrong here (NcButton)

ariaLabel Always try to provide an aria-label to your button. Make it more specific than the button's [text] by provide some more context.

@artonge
Copy link
Collaborator

artonge commented Jun 27, 2023

Not sure who to ping, but @nextcloud/designers or @JuliaKirschenheuter, would it make sense to enforce in @nc/vue that the text of NcButton matches its aria-label?

@Fenn-CS
Copy link
Contributor Author

Fenn-CS commented Jun 27, 2023

LGTM but if aria labels and button text should match, then we recommending something wrong here (NcButton)

ariaLabel Always try to provide an aria-label to your button. Make it more specific than the button's [text] by provide some more context.

Nice pointer. While I do some research, I would ping @michaelnissenbaum if he can provide us with more context.

@susnux
Copy link
Contributor

susnux commented Jun 27, 2023

So it looks like it should match: https://www.w3.org/WAI/WCAG21/Techniques/general/G211.html

But I also understand that you might want to give context, as Add is not very helpful, while Add selected to album might be better (just examples).
So I guess aria-label should be the same as the text and a more detailed description should be set to aria-description or aria-describedby or just to title?

@Fenn-CS
Copy link
Contributor Author

Fenn-CS commented Jun 27, 2023

@susnux

In general, it is recommended to make the "aria-label" text as descriptive as possible, while still being concise. This is because users who are relying on assistive technologies such as screen readers may not be able to see the visible text on the button, and need a clear and concise description of what the button does. If the visible text is not descriptive enough, the "aria-label" should provide additional information. For example, if the visible text on a button is "Submit", the "aria-label" could be "Submit the form to save changes".

However, in some cases, it may be appropriate to use the same text for both the visible text and the "aria-label". This is typically the case when the visible text is already descriptive and concise enough to provide an adequate accessible name for the element. In this case, using the same text for both the visible text and the "aria-label" can help to reduce confusion for users who may be using both visual and assistive technologies.

In summary, the decision of whether to use the same text for the visible text and the "aria-label" attribute depends on the context and the user needs. In general, it is recommended to make the "aria-label" text as descriptive as possible, while still being concise, to provide clear and meaningful information for users who may not be able to see the visible text on the element.

References:

W3C Accessibility Guidelines (WCAG) 2.0: https://www.w3.org/TR/WCAG20/
WebAIM: https://webaim.org/techniques/aria/

I believe in this case the right thing to do would be to make the original buttons more descriptive themselves.

@artonge artonge merged commit 0800408 into master Jun 27, 2023
23 checks passed
@artonge artonge deleted the 1675-correct-aria-label-on-create-album-button branch June 27, 2023 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants