From ee276b3747568fdaa8d0b72e3eaaa3456d412722 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Thu, 20 Feb 2025 15:01:22 +0000 Subject: [PATCH] Give banner role of 'status' if just an update We currently use the role of 'alert' for all banners. In recent accessibility testing, the Digital Accessibility Centre (DAC) suggested we should only be using that role for important or time-sensitive updates. This changes the banner component so the default role is 'status' to reflect that. In practice, this will change how the green banners are announced by screen readers. --- app/assets/javascripts/esm/focus-banner.mjs | 2 +- app/templates/components/banner.html | 2 +- .../email-reply-to/_verify-updates.html | 2 +- tests/javascripts/focus-banner.test.mjs | 29 ------------------- 4 files changed, 3 insertions(+), 32 deletions(-) diff --git a/app/assets/javascripts/esm/focus-banner.mjs b/app/assets/javascripts/esm/focus-banner.mjs index 1a60009769..d3580f35c3 100644 --- a/app/assets/javascripts/esm/focus-banner.mjs +++ b/app/assets/javascripts/esm/focus-banner.mjs @@ -23,7 +23,7 @@ class FocusBanner { // focus success and error banners when they appear in any content updates $(document).on("updateContent.onafterupdate", function(evt, el) { - this.focusBanner($(".banner-dangerous, .banner-default-with-tick", el)); + this.focusBanner($(".banner-dangerous", el)); }.bind(this)); } diff --git a/app/templates/components/banner.html b/app/templates/components/banner.html index e1484fdb09..83a8ae4e98 100644 --- a/app/templates/components/banner.html +++ b/app/templates/components/banner.html @@ -5,7 +5,7 @@ {% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None, context=None, action=None, id=None, thing=None) %}