Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toasts not being read by NVDA #97

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

None yet

4 participants