timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.84k stars 331 forks source link

ariaProps toastOptions do not work on the Toaster component #244

Open Slash52 opened 1 year ago

Slash52 commented 1 year ago

If I use

    <Toaster
      toastOptions={{
        duration: 7000,
        error: {
          ariaProps: { role: 'alert', 'aria-live': 'assertive' },
        },
      }}
    />

the role is not set on every

toast.error('error message')

call. the 'role' ist still 'status' .

But if I call the toast with

toast.error('error message', { ariaProps: { role: 'alert', 'aria-live': 'assertive' }})

it works as expected and the role attribute is set correctly.

Slash52 commented 1 year ago

stackblitz to reproduce

https://stackblitz.com/edit/vitejs-vite-rmtgsb?file=src/App.tsx

eddiej commented 1 year ago

I'm also having this issue.