fix(webui): pass aria-checked as a string literal on switch buttons

A11y checkers (axe-core / jsx-a11y) flag the boolean form because the
ARIA spec defines aria-checked as the enum "true" | "false" | "mixed",
not a boolean. React serialized the boolean to the right wire value at
runtime, but the inspection layer keys off the JSX expression's static
type. Switching to the explicit ternary silences both.
This commit is contained in:
DrSmoothl
2026-05-18 14:31:08 +08:00
parent a460433175
commit 7a2de230bf
2 changed files with 2 additions and 2 deletions
@@ -372,7 +372,7 @@ function ToggleSwitch({ value, onChange, ariaLabel }: ToggleSwitchProps) {
<button
type="button"
role="switch"
aria-checked={value}
aria-checked={value ? 'true' : 'false'}
aria-label={ariaLabel}
onClick={() => onChange(!value)}
className={cn(
@@ -112,7 +112,7 @@ function ToggleSwitch({ value, onChange, ariaLabel }: ToggleSwitchProps) {
<button
type="button"
role="switch"
aria-checked={value}
aria-checked={value ? 'true' : 'false'}
aria-label={ariaLabel}
onClick={() => onChange(!value)}
className={cn(