Skip to content

Commit

Permalink
Add aria-live to Toast
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Mar 15, 2024
1 parent fa33dde commit 6c782e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ export const Toast = ({

return <StyledToast
dismissAfterMs={dismissAfterMs}
inline={inline}>
inline={inline}
aria-live='polite'
>
<div className={variant}>
<div className='title'>{title}</div>
<div className='body'>
Expand Down
4 changes: 4 additions & 0 deletions src/components/__snapshots__/Toast.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`Toast has variants and inlines 1`] = `
<div
aria-live="polite"
className="sc-bczRLJ jAZNhq"
>
<div
Expand All @@ -23,6 +24,7 @@ exports[`Toast has variants and inlines 1`] = `

exports[`Toast has variants and inlines 2`] = `
<div
aria-live="polite"
className="sc-bczRLJ jAZNhq"
>
<div
Expand All @@ -44,6 +46,7 @@ exports[`Toast has variants and inlines 2`] = `

exports[`Toast has variants and inlines 3`] = `
<div
aria-live="polite"
className="sc-bczRLJ jSNerL"
>
<div
Expand All @@ -65,6 +68,7 @@ exports[`Toast has variants and inlines 3`] = `

exports[`Toast matches snapshot 1`] = `
<div
aria-live="polite"
className="sc-bczRLJ jAZNhq"
>
<div
Expand Down
6 changes: 6 additions & 0 deletions src/components/__snapshots__/ToastContainer.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`ToastContainer matches snapshot 1`] = `
className="sc-gsnTZi bQKHKA"
>
<div
aria-live="polite"
className="sc-bczRLJ jAZNhq"
>
<div
Expand All @@ -23,6 +24,7 @@ exports[`ToastContainer matches snapshot 1`] = `
</div>
</div>
<div
aria-live="polite"
className="sc-bczRLJ cWrNHg"
>
<div
Expand All @@ -41,6 +43,7 @@ exports[`ToastContainer matches snapshot 1`] = `
</div>
</div>
<div
aria-live="polite"
className="sc-bczRLJ loazPe"
>
<div
Expand All @@ -66,6 +69,7 @@ exports[`ToastContainer uses inline prop 1`] = `
className="sc-gsnTZi gRYEVl"
>
<div
aria-live="polite"
className="sc-bczRLJ jSNerL"
>
<div
Expand All @@ -84,6 +88,7 @@ exports[`ToastContainer uses inline prop 1`] = `
</div>
</div>
<div
aria-live="polite"
className="sc-bczRLJ fgCwHl"
>
<div
Expand All @@ -102,6 +107,7 @@ exports[`ToastContainer uses inline prop 1`] = `
</div>
</div>
<div
aria-live="polite"
className="sc-bczRLJ dGEkoL"
>
<div
Expand Down

0 comments on commit 6c782e8

Please sign in to comment.