Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/js/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export const Toast = function (instance) {
let container = getContainer();

this.toast = document.createElement('div');

// Add aria-live attribute to make the toast's notifications live and announce them to screen readers
this.toast.setAttribute('aria-live', 'polite');

this.toast.classList.add('toasted');

// add classes
Expand Down Expand Up @@ -132,6 +136,7 @@ export const Toast = function (instance) {

if(container === null) {
container = document.createElement('div');

container.id = instance.id;
document.body.appendChild(container);
}
Expand Down Expand Up @@ -523,4 +528,4 @@ export const Toast = function (instance) {
return this;
};

export default Toast;
export default Toast;