Skip to content

Commit 9ef77ed

Browse files
committed
fix: improve accessibility support wit aria-disabled & focus styles
1 parent 2273fc9 commit 9ef77ed

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

packages/pluggableWidgets/switch-web/src/components/Switch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function Switch(props: SwitchProps): ReactElement {
3838
role="switch"
3939
aria-checked={props.isChecked}
4040
aria-labelledby={`${props.id}-label`}
41-
aria-readonly={!props.editable}
41+
aria-disabled={!props.editable}
4242
>
4343
<div
4444
className={classNames("widget-switch-btn", {

packages/pluggableWidgets/switch-web/src/ui/_switch.scss

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
.widget-switch-btn-wrapper {
44
margin-bottom: 8px;
55

6-
&:focus {
7-
outline: 1px solid #0595db;
8-
}
9-
106
&.disabled {
117
cursor: default;
128
}
@@ -30,3 +26,12 @@
3026
}
3127
}
3228
}
29+
30+
.form-group:focus-within {
31+
&:has(.widget-switch) {
32+
outline: 5px auto -webkit-focus-ring-color;
33+
}
34+
.widget-switch-btn-wrapper:focus {
35+
outline: none;
36+
}
37+
}

0 commit comments

Comments
 (0)