shakee93 / vue-toasted

🖖 Responsive Touch Compatible Toast plugin for VueJS 2+
https://shakee93.github.io/vue-toasted/
MIT License
2.21k stars 194 forks source link

Aria Role should be configurable #214

Open tkalmar opened 2 years ago

tkalmar commented 2 years ago

The attributes set here are redundant.

Elements with the role status have an implicit aria-live value of polite and an implicit aria-atomic value of true.

It would be nice if one could change the role. For example for alerts it would be more suitable to set the role to alert This would allow users of screen readers to get immediately get notified about the message.

my current workaround is:

const parent = error.el.parentElement;
parent?.setAttribute('role', 'alert');
parent?.setAttribute('aria-live', 'assertive');
parent?.setAttribute('aria-atomic', 'true');

The aria-live and aria-atomic are here also redundant but needed because of the initial set attributes.