* Focus flash message button on load * update specs * Update app/javascript/packs/admin/flashMessages.js Co-authored-by: Nick Taylor <nick@iamdeveloper.com> * Update app/javascript/packs/admin/flashMessages.js Co-authored-by: Nick Taylor <nick@iamdeveloper.com> Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
6 lines
387 B
JavaScript
6 lines
387 B
JavaScript
const [ firstFlashDismissBtn ] =
|
|
document.getElementsByClassName('js-flash-close-btn');
|
|
|
|
// This allows screen reader users to become aware of the message (as well as bringing focus to the top of the main content).
|
|
// (we don't use aria-live or role="alert" on the message text as these are not reliably announced for content that exists from page load)
|
|
firstFlashDismissBtn?.focus();
|