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

Feature/sc 109316/fe pro dashboard accessibility fixes #899

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
Prev Previous commit
Next Next commit
fix toggle
meetup-oleksandr-dudiuk committed Jan 26, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit d717182309bb82595b01464bda429c40ec14f36d
7 changes: 7 additions & 0 deletions src/forms/ToggleSwitch.jsx
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ class ToggleSwitch extends React.Component {
id,
name,
disabled,
ariaLabel,
...other
} = this.props;

@@ -40,6 +41,12 @@ class ToggleSwitch extends React.Component {
aria-checked={checked}
aria-readonly={disabled}
disabled={disabled}
aria-label={
ariaLabel ||
(typeof label === 'string'
? `${label} - toggle switch`
: 'toggle switch')
}
{...labelProps}
{...other}
>
2 changes: 2 additions & 0 deletions src/interactive/__snapshots__/accordionPanel.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -218,6 +218,7 @@ exports[`AccordionPanel Locked panel with toggle switch renders locked toggle pa
<div>
<button
aria-checked={false}
aria-label="toggle switch"
aria-labelledby="label-firstsection"
aria-readonly={false}
className="toggleSwitch"
@@ -703,6 +704,7 @@ exports[`AccordionPanel Panel with toggle switch exists and renders a toggle swi
<div>
<button
aria-checked={false}
aria-label="toggle switch"
aria-labelledby="label-firstsection"
aria-readonly={false}
className="toggleSwitch"