Skip to content

Commit

Permalink
Update live region
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerJDev committed Jul 22, 2024
1 parent ce96e18 commit e37e050
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react/src/ToggleSwitch/ToggleSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import sx from '../sx'
import getGlobalFocusStyles from '../internal/utils/getGlobalFocusStyles'
import VisuallyHidden from '../_VisuallyHidden'
import type {CellAlignment} from '../DataTable/column'
import {AriaStatus} from '../live-region'

const TRANSITION_DURATION = '80ms'
const EASE_OUT_QUAD_CURVE = 'cubic-bezier(0.5, 1, 0.89, 1)'
Expand Down Expand Up @@ -311,9 +312,9 @@ const ToggleSwitch = React.forwardRef<HTMLButtonElement, React.PropsWithChildren
>
{isLoadingLabelVisible ? (
<VisuallyHidden>
<span aria-live="polite" id={loadingLabelId}>
<AriaStatus announceOnShow id={loadingLabelId}>
{loadingLabel}
</span>
</AriaStatus>
</VisuallyHidden>
) : null}
{loading ? <Spinner size="small" /> : null}
Expand Down

0 comments on commit e37e050

Please sign in to comment.