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

improve accessibility to support more/less buttons #596

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pages/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ <h2>Get in touch</h2>
});
const toggleHiddenLinks = (footerElement) => {
const footerText = footerElement.querySelector('.footer-text');
const toggleButton = footerElement.querySelector("button");
const cardElement = footerElement.parentElement;
const bodyElement = cardElement.querySelector('.usa-card__body');
const hiddenLinks = cardElement.querySelectorAll('.hidden-link');
Expand All @@ -197,10 +198,14 @@ <h2>Get in touch</h2>
bodyElement.classList.add('expanded');
animateCSS(link, 'fadeInDown');
footerText.textContent = 'Less';
footerText.setAttribute("aria-label", "see less helpful links")
Copy link
Contributor

@johanna-skylight johanna-skylight Sep 6, 2023

Choose a reason for hiding this comment

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

is there a way to pass the category to this method so it reads 'see more account management related links', 'see more testing related links'.

Also the copy of see less helpful links sounds odd as I thought it was offered to see some not so helpful links LOL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! honestly I dont know why we even have the more/less link, we dont have that many links anyway, might as well always show it!

toggleButton.setAttribute("aria-expanded", true)
} else {
animateCSS(link, 'fadeOutUp');
bodyElement.classList.remove('expanded');
footerText.textContent = 'More';
footerText.setAttribute("aria-label", "see more helpful links")
toggleButton.setAttribute("aria-expanded", false)
}
});
}
Expand Down
Loading