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[dev]: ✨ implement A11y improvements to sd-expandable #1476

Closed
2 of 7 tasks
Tracked by #1465
yoezlem opened this issue Oct 9, 2024 · 0 comments · Fixed by #1724
Closed
2 of 7 tasks
Tracked by #1465

feat[dev]: ✨ implement A11y improvements to sd-expandable #1476

yoezlem opened this issue Oct 9, 2024 · 0 comments · Fixed by #1724
Assignees
Labels
A11y Audit Identifies tasks related to accessibility improvements identified in the A11y audit of the DS 🔧 code needs changes in code Critical A11y Issue Require immediate attention and resolution Subtask Epic subtasks

Comments

@yoezlem
Copy link
Contributor

yoezlem commented Oct 9, 2024

Description

This task describes the Storybook implementation for the sd-expandable component as part of the A11y improvements outlined in Epic #1465.

A11y improvements for sd-checkbox can be found here: sd-expandable Notes.


Comment

I don't know what to do with this pattern. There are two issues that I don't know how to solve with the current implementation:

  1. Content is only visually hidden, meaning screen reader users will always have access to the entire content.
  2. The button is useless for most screen reader users because it only controls the visual rather than the semantic visibility of the content.

Some thoughts:

  • Setting aria-hidden=true on the button is not an option because aria-hidden interactive elements are still accessible to screen reader users who use the Tab key.
    You could split the content slot into two slots, one that contains the visible portion and another that includes the entire (probably easier than the remaining) content. You swap them when the user clicks the button.
  • That would eliminate the need for --component-expandable-max-block-size.
  • You would have to add and toggle aria-expanded on the button.
  • That makes animation trickier if you decide to add a transition.

Best Practices

  • Only hide non-critical content
  • Avoid generic summaries like “show more”

Solution

We move the button element before the content which is hidden for screen readers until the user clicks the button. The button should also receive an explanatory screen reader information about the possibility to show the expandable content.

Pls also change the button text to something more specific and add a11y hints like mentioned in the best practices above.

NOTE: pls also have a look into the template in order to make it work properly and descriptions and labels match the content shown in the template.

DoR

  • Item has been estimated by the team
  • Item dependencies have been identified and documented

DoD

  • Documentation has been created/updated (if applicable)
  • Migration Guide has been created/updated (if applicable)
  • Relevant E2E tests (Features, A11y, Bug fixes) are created/updated
  • Relevant stories (Features, A11y) are created/updated
  • Implementation works successfully on feature branch
@yoezlem yoezlem added 🔧 code needs changes in code Subtask Epic subtasks labels Oct 9, 2024
@yoezlem yoezlem added A11y Audit Identifies tasks related to accessibility improvements identified in the A11y audit of the DS Critical A11y Issue Require immediate attention and resolution labels Oct 9, 2024
@coraliefeil coraliefeil moved this from 📋 Backlog to ⚙️ To be refined in Solid Design System Project Board Dec 6, 2024
@karlbaumhauer karlbaumhauer moved this from ⚙️ To be refined to 🔖 Ready in Solid Design System Project Board Dec 6, 2024
@paulovareiro29 paulovareiro29 self-assigned this Dec 9, 2024
@paulovareiro29 paulovareiro29 moved this from 🔖 Ready to 🏗 In progress in Solid Design System Project Board Dec 9, 2024
@paulovareiro29 paulovareiro29 moved this from 🏗 In progress to 👀 In review in Solid Design System Project Board Dec 11, 2024
paulovareiro29 added a commit that referenced this issue Jan 15, 2025
<!-- ## Title: Please consider adding the [skip chromatic] flag to the
PR title in case you dont need chromatic testing your changes. -->
## Description:
Closes #1476 and #1778

This PR addresses:
- Adjust sd-expandable spacings according to figma
- Reorder of sd-expandable dom order. (button first so it is targetable
by keyboard first)
- Improvement of the sd-expandable template labels
- Added accessibility hints to sd-expandable

## Definition of Reviewable:
<!-- *PR notes: Irrelevant elements should be removed.* -->
- [x] Documentation is created/updated
- [ ] Migration Guide is created/updated
- [ ] E2E tests (features, a11y, bug fixes) are created/updated
<!-- *If this PR includes a bug fix, an E2E test is necessary to verify
the change. If the fix is purely visual, ensuring it is captured within
our chromatic screenshot tests is sufficient.* -->
- [x] Stories (features, a11y) are created/updated
- [x] relevant tickets are linked

---------

Co-authored-by: Mario Hamann <[email protected]>
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Solid Design System Project Board Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A11y Audit Identifies tasks related to accessibility improvements identified in the A11y audit of the DS 🔧 code needs changes in code Critical A11y Issue Require immediate attention and resolution Subtask Epic subtasks
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants