MDL-67663 core: Do not use aria-hidden="false" on drawer
authorJun Pataleta <jun@moodle.com>
Wed, 1 Apr 2020 03:33:38 +0000 (11:33 +0800)
committerJun Pataleta <jun@moodle.com>
Thu, 9 Apr 2020 09:50:09 +0000 (17:50 +0800)
From https://www.w3.org/TR/wai-aria-1.1/#aria-hidden:
* "aria-hidden="false" is known to work inconsistently in browsers"

lib/amd/build/drawer.min.js
lib/amd/build/drawer.min.js.map
lib/amd/src/drawer.js
lib/templates/drawer.mustache

index 0f035c1..141e339 100644 (file)
Binary files a/lib/amd/build/drawer.min.js and b/lib/amd/build/drawer.min.js differ
index 9f97f5b..267e20a 100644 (file)
Binary files a/lib/amd/build/drawer.min.js.map and b/lib/amd/build/drawer.min.js.map differ
index a24cd30..3c77606 100644 (file)
@@ -32,7 +32,7 @@ import DrawerEvents from 'core/drawer_events';
 const show = (root) => {
     root.removeClass('hidden');
     root.attr('aria-expanded', true);
-    root.attr('aria-hidden', false);
+    root.removeAttr('aria-hidden');
     root.focus();
 
     PubSub.publish(DrawerEvents.DRAWER_SHOWN, root);
index e21fd2f..4daa4df 100644 (file)
@@ -35,7 +35,7 @@
     id="{{$drawerid}}drawer-{{uniqid}}{{/drawerid}}"
     class="{{$drawerclasses}}{{/drawerclasses}} drawer bg-white {{^show}}hidden{{/show}}"
     aria-expanded="{{#show}}true{{/show}}{{^show}}false{{/show}}"
-    aria-hidden="{{#show}}false{{/show}}{{^show}}true{{/show}}"
+    {{^show}}aria-hidden="true"{{/show}}
     data-region="right-hand-drawer"
     role="region"
     tabindex="-1"