-
Notifications
You must be signed in to change notification settings - Fork 236
fix(clear-button): updates documentation, examples and adds tests for clear button accessibility #5861
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
base: main
Are you sure you want to change the base?
Conversation
|
📚 Branch Preview🔍 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
nikkimk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The documentation site is not reflecting the changes in the markdown. im going to check it out locally but we might need to investigate why thats not working |
The documentation system Currently:
There are several ways to tackle this but would be a good follow up fix. |
72d949e to
619e7f0
Compare
619e7f0 to
33b07cf
Compare

Description
Fixed accessibility violations in the
<sp-clear-button>documentation by adding the requiredlabelattribute to all examples. The component implementation already correctly handles thelabelattribute (via theLikeAnchormixin), but the documentation examples were missing it, causing WCAG 2.1 Level A violations (4.1.2 Name, Role, Value) when rendered on the documentation site.Additionally:
ClearButtonoverridesbuttonContentand does not render slot content)ClearButton.tsto accurately document thelabelattribute instead of the non-functional slotaria-labelbehaviorMotivation and context
Users running Axe DevTools on https://swcpreviews.z13.web.core.windows.net/pr-5861/docs/components/clear-button reported "ARIA commands must have an accessible name" violations. The clear button examples were missing the
labelattribute, which is the only way to provide an accessible name since the component only renders an icon (no slot content).Related issue(s)
Author's checklist
Reviewer's checklist
Manual review test cases
Verify all clear-button examples on documentation page have accessible names
Verify clear button aria-label is set correctly
<sp-clear-button label="Clear">elementrole="button"andaria-label="Clear"on the host element