fix(close-button): add a default slot containing visually hidden text for close button#5881
fix(close-button): add a default slot containing visually hidden text for close button#5881
Conversation
🦋 Changeset detectedLatest commit: d92eddb The changes in this PR will be included in the next version bump. This PR includes changesets to release 78 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📚 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 |
2b5f3f1 to
b13b306
Compare
|
@cdransf Disabled buttons will not be included in the tab order. The assertion should be "A screen reader should announce the label “Disabled” along with its disabled state when the element is programmatically focused or inspected" |
rise-erpelding
left a comment
There was a problem hiding this comment.
This looks great! I think this only needs a changeset, and it's good to go!
I can hear slot content/label attributes being announced, and noted that running axe DevTools on the updated docs page, the "ARIA commands must have an accessible name" issue disappears! 🙌
8f21057 to
416d74e
Compare
📚 Branch Preview Links🔍 First Generation 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 |
… for close button
416d74e to
d92eddb
Compare
fix(close-button): add accessible name support for default slot
Description
Added visually hidden default slot rendering to
sp-close-buttonso text content is accessible to screen readers while remaining invisible to sighted users.Changes:
.visually-hiddenstyling inCloseButton.ts.visually-hiddenCSS class toclose-button-overrides.cssMotivation and context
<sp-close-button>Close</sp-close-button>had no accessible name for screen readers because the default slot wasn't being rendered. This caused WCAG 4.1.2 (Name, Role, Value - Level A) violations when using slot content instead of thelabelattribute.The
labelattribute already worked correctly (viaaria-label), but the documented default slot pattern was inaccessible.Related issue(s)
SWC-1150Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Verify accessible name with default slot
<sp-close-button>Close</sp-close-button>examplesVerify disabled state accessibility
<sp-close-button disabled>Disabled</sp-close-button>Verify label attribute still works
<sp-close-button label="Close"></sp-close-button>Device review