Skip to content

Conversation

pjsachdev
Copy link

Fantastic library, thank you very much for building it!

I noticed whilst testing with NVDA that the toasts were not being spoken by the screen reader. I believe this is because aria-live regions need to be in the DOM on page load.

This PR adds the aria-live="polite" attribute to the Toaster component which seems to resolve the issue with NVDA.

@vercel
Copy link

vercel bot commented Jun 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/timo/react-hot-toast/BUgTPnWTwMHZu2k2GfbDPy9P9Von
✅ Preview: https://react-hot-toast-git-fork-pjsachdev-aria-live-timo1.vercel.app

@javagaba
Copy link

Can we get this merged?

@timolins
Copy link
Owner

Hey! Thanks for this PR.

I'm wondering how this impacts the per-toast API:

'aria-live': 'polite',

Will this overwrite this behaviour?

@diondiondion
Copy link

Will this overwrite this behaviour?

I think so. If you wanted to keep the per-toast option, you'd probably need to render a toast container for each required politeness level and render toasts into the appropriate one as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants