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

aria-label and button text mismatch #81

Closed
irv opened this issue Oct 9, 2024 · 1 comment
Closed

aria-label and button text mismatch #81

irv opened this issue Oct 9, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@irv
Copy link

irv commented Oct 9, 2024

Following on from #75

WCAG 2.2 wants to aria-label value to be the same as the button text (e.g. "Show more")

ref https://www.w3.org/WAI/WCAG22/Techniques/failures/F96

It seems as simple a fix as the below?

index 450faff..880159e 100644
--- a/static/js/showMore.js
+++ b/static/js/showMore.js
@@ -175,7 +175,7 @@ var ShowMore = (function () {
         btnClassAppend
       } = _ref;
       const typeAria = this._checkExp ? less || "" : more || "";
-      const label = this._checkExp ? "collapse" : "expand";
+      const label = this._checkExp ? less : more;
       const expanded = this._checkExp ? true : false;
       const button = createElement("button");
       button.className = btnClassAppend == null ? btnClass : btnClass + " " + btnClassAppend;
@tomickigrzegorz
Copy link
Owner

Thanks,
I'll have a moment to check, I'm not an expert in WCAG 2.2 ;)

@tomickigrzegorz tomickigrzegorz self-assigned this Oct 15, 2024
@tomickigrzegorz tomickigrzegorz added the question Further information is requested label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants