MDL-68390 js: Update to use Aria mod
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 9 Apr 2020 13:25:07 +0000 (21:25 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 15 Jul 2020 06:40:49 +0000 (14:40 +0800)
35 files changed:
admin/tool/usertours/amd/build/tour.min.js.map
admin/tool/usertours/amd/src/tour.js
blocks/myoverview/amd/build/view.min.js
blocks/myoverview/amd/build/view.min.js.map
blocks/myoverview/amd/src/view.js
blocks/navigation/amd/build/ajax_response_renderer.min.js
blocks/navigation/amd/build/ajax_response_renderer.min.js.map
blocks/navigation/amd/src/ajax_response_renderer.js
blocks/recentlyaccessedcourses/amd/build/main.min.js
blocks/recentlyaccessedcourses/amd/build/main.min.js.map
blocks/recentlyaccessedcourses/amd/src/main.js
lib/amd/build/drawer.min.js
lib/amd/build/drawer.min.js.map
lib/amd/build/form-autocomplete.min.js
lib/amd/build/form-autocomplete.min.js.map
lib/amd/build/modal.min.js
lib/amd/build/modal.min.js.map
lib/amd/build/tooltip.min.js
lib/amd/build/tooltip.min.js.map
lib/amd/build/tree.min.js
lib/amd/build/tree.min.js.map
lib/amd/src/drawer.js
lib/amd/src/form-autocomplete.js
lib/amd/src/modal.js
lib/amd/src/tooltip.js
lib/amd/src/tree.js
message/amd/build/message_drawer_router.min.js
message/amd/build/message_drawer_router.min.js.map
message/amd/build/message_drawer_view_conversation_renderer.min.js
message/amd/build/message_drawer_view_conversation_renderer.min.js.map
message/amd/src/message_drawer_router.js
message/amd/src/message_drawer_view_conversation_renderer.js
theme/boost/amd/build/drawer.min.js
theme/boost/amd/build/drawer.min.js.map
theme/boost/amd/src/drawer.js

index bc48f5c..c305e7a 100644 (file)
Binary files a/admin/tool/usertours/amd/build/tour.min.js.map and b/admin/tool/usertours/amd/build/tour.min.js.map differ
index 4a2fd90..393f546 100644 (file)
@@ -594,7 +594,7 @@ export default class Tour {
             });
         }
 
-        this.listeners.forEach(function (listener) {
+        this.listeners.forEach(function(listener) {
             listener.node.on.apply(listener.node, listener.args);
         });
 
index 7ee4ae4..8e18c99 100644 (file)
Binary files a/blocks/myoverview/amd/build/view.min.js and b/blocks/myoverview/amd/build/view.min.js differ
index 581a46a..723993f 100644 (file)
Binary files a/blocks/myoverview/amd/build/view.min.js.map and b/blocks/myoverview/amd/build/view.min.js.map differ
index 9d637b7..524c4ba 100644 (file)
@@ -33,6 +33,7 @@ define(
     'core_course/events',
     'block_myoverview/selectors',
     'core/paged_content_events',
+    'core/aria',
 ],
 function(
     $,
@@ -44,7 +45,8 @@ function(
     Templates,
     CourseEvents,
     Selectors,
-    PagedContentEvents
+    PagedContentEvents,
+    Aria
 ) {
 
     var SELECTORS = {
@@ -174,12 +176,14 @@ function(
      */
     var hideFavouriteIcon = function(root, courseId) {
         var iconContainer = getFavouriteIconContainer(root, courseId);
+
         var isFavouriteIcon = iconContainer.find(SELECTORS.ICON_IS_FAVOURITE);
         isFavouriteIcon.addClass('hidden');
-        isFavouriteIcon.attr('aria-hidden', true);
+        Aria.hide(isFavouriteIcon);
+
         var notFavourteIcon = iconContainer.find(SELECTORS.ICON_NOT_FAVOURITE);
         notFavourteIcon.removeClass('hidden');
-        notFavourteIcon.attr('aria-hidden', false);
+        Aria.unhide(notFavourteIcon);
     };
 
     /**
@@ -190,12 +194,14 @@ function(
      */
     var showFavouriteIcon = function(root, courseId) {
         var iconContainer = getFavouriteIconContainer(root, courseId);
+
         var isFavouriteIcon = iconContainer.find(SELECTORS.ICON_IS_FAVOURITE);
         isFavouriteIcon.removeClass('hidden');
-        isFavouriteIcon.attr('aria-hidden', false);
+        Aria.unhide(isFavouriteIcon);
+
         var notFavourteIcon = iconContainer.find(SELECTORS.ICON_NOT_FAVOURITE);
         notFavourteIcon.addClass('hidden');
-        notFavourteIcon.attr('aria-hidden', true);
+        Aria.hide(notFavourteIcon);
     };
 
     /**
index dead3b8..7be3a49 100644 (file)
Binary files a/blocks/navigation/amd/build/ajax_response_renderer.min.js and b/blocks/navigation/amd/build/ajax_response_renderer.min.js differ
index 2bc3203..c729061 100644 (file)
Binary files a/blocks/navigation/amd/build/ajax_response_renderer.min.js.map and b/blocks/navigation/amd/build/ajax_response_renderer.min.js.map differ
index 99f2e28..e92ed46 100644 (file)
  * @copyright  2015 John Okely <john@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-define(['jquery', 'core/templates', 'core/notification', 'core/url'], function($, Templates, Notification, Url) {
+define([
+    'jquery',
+    'core/templates',
+    'core/notification',
+    'core/url',
+    'core/aria',
+], function(
+    $,
+    Templates,
+    Notification,
+    Url,
+    Aria
+) {
 
     // Mappings for the different types of nodes coming from the navigation.
     // Copied from lib/navigationlib.php navigation_node constants.
@@ -43,7 +55,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/url'], function($
     function buildDOM(rootElement, nodes) {
         var ul = $('<ul></ul>');
         ul.attr('role', 'group');
-        ul.attr('aria-hidden', true);
+        Aria.hide(ul);
 
         $.each(nodes, function(index, node) {
             if (typeof node !== 'object') {
@@ -153,7 +165,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/url'], function($
                 var group = element.find('#' + item.attr('aria-owns'));
 
                 item.attr('aria-expanded', true);
-                group.attr('aria-hidden', false);
+                Aria.unhide(group);
             } else {
                 if (element.parent().hasClass('contains_branch')) {
                     element.parent().removeClass('contains_branch');
index 4d8e69f..54f17c8 100644 (file)
Binary files a/blocks/recentlyaccessedcourses/amd/build/main.min.js and b/blocks/recentlyaccessedcourses/amd/build/main.min.js differ
index 6fdffbc..7d74c0f 100644 (file)
Binary files a/blocks/recentlyaccessedcourses/amd/build/main.min.js.map and b/blocks/recentlyaccessedcourses/amd/build/main.min.js.map differ
index ca3186b..9af85cb 100644 (file)
@@ -32,6 +32,7 @@ define(
         'core/templates',
         'core_course/events',
         'core_course/repository',
+        'core/aria',
     ],
     function(
         $,
@@ -41,7 +42,8 @@ define(
         PagedContentPagingBar,
         Templates,
         CourseEvents,
-        CoursesRepository
+        CoursesRepository,
+        Aria
     ) {
 
         // Constants.
@@ -96,7 +98,7 @@ define(
             var pagingBar = root.find(SELECTORS.PAGING_BAR);
             pagingBar.css('opacity', 1);
             pagingBar.css('visibility', 'visible');
-            pagingBar.attr('aria-hidden', 'false');
+            Aria.unhide(pagingBar);
         };
 
         /**
@@ -108,7 +110,7 @@ define(
             var pagingBar = root.find(SELECTORS.PAGING_BAR);
             pagingBar.css('opacity', 0);
             pagingBar.css('visibility', 'hidden');
-            pagingBar.attr('aria-hidden', 'true');
+            Aria.hide(pagingBar);
         };
 
         /**
index 760a674..c1e1118 100644 (file)
Binary files a/lib/amd/build/drawer.min.js and b/lib/amd/build/drawer.min.js differ
index 82cdd89..c8884f7 100644 (file)
Binary files a/lib/amd/build/drawer.min.js.map and b/lib/amd/build/drawer.min.js.map differ
index 8ef27f0..58ca652 100644 (file)
Binary files a/lib/amd/build/form-autocomplete.min.js and b/lib/amd/build/form-autocomplete.min.js differ
index 77c999b..8ab6a51 100644 (file)
Binary files a/lib/amd/build/form-autocomplete.min.js.map and b/lib/amd/build/form-autocomplete.min.js.map differ
index f1816d7..530e371 100644 (file)
Binary files a/lib/amd/build/modal.min.js and b/lib/amd/build/modal.min.js differ
index 297ee6c..7935256 100644 (file)
Binary files a/lib/amd/build/modal.min.js.map and b/lib/amd/build/modal.min.js.map differ
index 2771c34..30b444e 100644 (file)
Binary files a/lib/amd/build/tooltip.min.js and b/lib/amd/build/tooltip.min.js differ
index 43e02fb..94aa7cb 100644 (file)
Binary files a/lib/amd/build/tooltip.min.js.map and b/lib/amd/build/tooltip.min.js.map differ
index 295ca56..7fadd34 100644 (file)
Binary files a/lib/amd/build/tree.min.js and b/lib/amd/build/tree.min.js differ
index 21b9d89..b7d4e17 100644 (file)
Binary files a/lib/amd/build/tree.min.js.map and b/lib/amd/build/tree.min.js.map differ
index 3c77606..00742af 100644 (file)
@@ -22,6 +22,7 @@
  */
 import $ from 'jquery';
 import * as PubSub from 'core/pubsub';
+import * as Aria from 'core/aria';
 import DrawerEvents from 'core/drawer_events';
 
 /**
@@ -29,10 +30,13 @@ import DrawerEvents from 'core/drawer_events';
  *
  * @param {Object} root The drawer container.
  */
-const show = (root) => {
+const show = root => {
+    // Ensure that it is a jQuery.
+    root = $(root);
+
+    Aria.unhide(root.get());
     root.removeClass('hidden');
     root.attr('aria-expanded', true);
-    root.removeAttr('aria-hidden');
     root.focus();
 
     PubSub.publish(DrawerEvents.DRAWER_SHOWN, root);
@@ -43,10 +47,14 @@ const show = (root) => {
  *
  * @param {Object} root The drawer container.
  */
-const hide = (root) => {
+const hide = root => {
+    // Ensure that it is a jQuery.
+    root = $(root);
+
     root.addClass('hidden');
     root.attr('aria-expanded', false);
-    root.attr('aria-hidden', true);
+    Aria.hide(root.get());
+
     PubSub.publish(DrawerEvents.DRAWER_HIDDEN, root);
 };
 
index b91c5fb..f90ff66 100644 (file)
@@ -25,8 +25,8 @@
  */
 /* globals require: false */
 define(
-    ['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification', 'core/loadingicon'],
-function($, log, str, templates, notification, LoadingIcon) {
+    ['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification', 'core/loadingicon', 'core/aria'],
+function($, log, str, templates, notification, LoadingIcon, Aria) {
 
     // Private functions and variables.
     /** @var {Object} KEYS - List of keycode constants. */
@@ -200,14 +200,14 @@ function($, log, str, templates, notification, LoadingIcon) {
         var suggestionsElement = $(document.getElementById(state.suggestionsId));
 
         // Count the visible items.
-        var length = suggestionsElement.children('[aria-hidden=false]').length;
+        var length = suggestionsElement.children(':not([aria-hidden])').length;
         // Limit the index to the upper/lower bounds of the list (wrap in both directions).
         index = index % length;
         while (index < 0) {
             index += length;
         }
         // Find the specified element.
-        var element = $(suggestionsElement.children('[aria-hidden=false]').get(index));
+        var element = $(suggestionsElement.children(':not([aria-hidden])').get(index));
         // Find the index of this item in the full list of suggestions (including hidden).
         var globalIndex = $(suggestionsElement.children('[role=option]')).index(element);
         // Create an id we can assign to this element.
@@ -244,7 +244,7 @@ function($, log, str, templates, notification, LoadingIcon) {
         // Find the active one.
         var element = suggestionsElement.children('[aria-selected=true]');
         // Find it's index.
-        var current = suggestionsElement.children('[aria-hidden=false]').index(element);
+        var current = suggestionsElement.children(':not([aria-hidden])').index(element);
         // Activate the next one.
         return activateItem(current + 1, state);
     };
@@ -315,7 +315,7 @@ function($, log, str, templates, notification, LoadingIcon) {
         var element = suggestionsElement.children('[aria-selected=true]');
 
         // Find it's index.
-        var current = suggestionsElement.children('[aria-hidden=false]').index(element);
+        var current = suggestionsElement.children(':not([aria-hidden])').index(element);
 
         // Activate the previous one.
         return activateItem(current - 1, state);
@@ -338,7 +338,8 @@ function($, log, str, templates, notification, LoadingIcon) {
         inputElement.attr('aria-expanded', false).attr('aria-activedescendant', state.selectionId);
 
         // Hide the suggestions list (from screen readers too).
-        suggestionsElement.hide().attr('aria-hidden', true);
+        Aria.hide(suggestionsElement.get());
+        suggestionsElement.hide();
 
         return $.Deferred().resolve();
     };
@@ -385,17 +386,22 @@ function($, log, str, templates, notification, LoadingIcon) {
 
             // Get the element again.
             suggestionsElement = $(document.getElementById(state.suggestionsId));
+
             // Show it if it is hidden.
-            suggestionsElement.show().attr('aria-hidden', false);
+            Aria.unhide(suggestionsElement.get());
+            suggestionsElement.show();
+
             // For each option in the list, hide it if it doesn't match the query.
             suggestionsElement.children().each(function(index, node) {
                 node = $(node);
                 if ((options.caseSensitive && node.text().indexOf(searchquery) > -1) ||
                         (!options.caseSensitive && node.text().toLocaleLowerCase().indexOf(searchquery) > -1)) {
-                    node.show().attr('aria-hidden', false);
+                    Aria.unhide(node.get());
+                    node.show();
                     matchingElements = true;
                 } else {
-                    node.hide().attr('aria-hidden', true);
+                    node.hide();
+                    Aria.hide(node.get());
                 }
             });
             // If we found any matches, show the list.
@@ -779,7 +785,7 @@ function($, log, str, templates, notification, LoadingIcon) {
             var element = $(e.currentTarget).closest('[role=option]');
             var suggestionsElement = $(document.getElementById(state.suggestionsId));
             // Find the index of the clicked on suggestion.
-            var current = suggestionsElement.children('[aria-hidden=false]').index(element);
+            var current = suggestionsElement.children(':not([aria-hidden])').index(element);
 
             // Activate it.
             activateItem(current, state)
@@ -1020,7 +1026,8 @@ function($, log, str, templates, notification, LoadingIcon) {
                 return false;
             }
 
-            originalSelect.css('visibility', 'hidden').attr('aria-hidden', true);
+            Aria.hide(originalSelect.get());
+            originalSelect.css('visibility', 'hidden');
 
             // Hide the original select.
 
@@ -1105,7 +1112,8 @@ function($, log, str, templates, notification, LoadingIcon) {
 
                 var suggestionsElement = $(document.getElementById(state.suggestionsId));
                 // Hide the suggestions by default.
-                suggestionsElement.hide().attr('aria-hidden', true);
+                suggestionsElement.hide();
+                Aria.hide(suggestionsElement.get());
 
                 return;
             })
index 184c8d6..823adcd 100644 (file)
@@ -733,10 +733,11 @@ define([
      * @method accessibilityShow
      */
     Modal.prototype.accessibilityShow = function() {
-        Aria.hideSiblings(this.root.get()[0]);
-
         // Make us visible to screen readers.
-        this.root.removeAttr('aria-hidden');
+        Aria.unhide(this.root.get());
+
+        // Hide siblings.
+        Aria.hideSiblings(this.root.get()[0]);
     };
 
     /**
@@ -747,9 +748,11 @@ define([
      * @method accessibilityHide
      */
     Modal.prototype.accessibilityHide = function() {
-        this.root.attr('aria-hidden', 'true');
-
+        // Unhide siblings.
         Aria.unhideSiblings(this.root.get()[0]);
+
+        // Hide this modal.
+        Aria.hide(this.root.get());
     };
 
     /**
index 7faaf95..af25345 100644 (file)
@@ -1,4 +1,4 @@
-define(['jquery'], function($) {
+define(['jquery', 'core/aria'], function($, Aria) {
 
     /**
      * Tooltip class.
@@ -50,7 +50,7 @@ define(['jquery'], function($) {
             var tooltipele = $(document.getElementById(tooltipId));
 
             tooltipele.show();
-            tooltipele.attr('aria-hidden', 'false');
+            Aria.unhide(tooltipele);
 
             if (!tooltipele.is('.tooltip')) {
                 // Change the markup to a bootstrap tooltip.
@@ -79,7 +79,7 @@ define(['jquery'], function($) {
             var tooltipele = document.getElementById(tooltipId);
 
             $(tooltipele).hide();
-            $(tooltipele).attr('aria-hidden', 'true');
+            Aria.hide(tooltipele);
         }
     };
 
index 24fd7da..0839895 100644 (file)
@@ -303,7 +303,7 @@ define(['jquery'], function($) {
     Tree.prototype.finishExpandingGroup = function(item) {
         // Expand the group.
         var group = this.getGroupFromItem(item);
-        group.attr('aria-hidden', 'false');
+        group.removeAttr('aria-hidden');
         item.attr('aria-expanded', 'true');
 
         // Update the list of visible items.
index 01a224c..c3c42e4 100644 (file)
Binary files a/message/amd/build/message_drawer_router.min.js and b/message/amd/build/message_drawer_router.min.js differ
index 47cc497..e2f106e 100644 (file)
Binary files a/message/amd/build/message_drawer_router.min.js.map and b/message/amd/build/message_drawer_router.min.js.map differ
index 6d35cae..9c3f4f9 100644 (file)
Binary files a/message/amd/build/message_drawer_view_conversation_renderer.min.js and b/message/amd/build/message_drawer_view_conversation_renderer.min.js differ
index 6bd9db1..0248160 100644 (file)
Binary files a/message/amd/build/message_drawer_view_conversation_renderer.min.js.map and b/message/amd/build/message_drawer_view_conversation_renderer.min.js.map differ
index f5db00f..119e081 100644 (file)
@@ -29,13 +29,15 @@ define(
     'jquery',
     'core/pubsub',
     'core/str',
-    'core_message/message_drawer_events'
+    'core_message/message_drawer_events',
+    'core/aria',
 ],
 function(
     $,
     PubSub,
     Str,
-    MessageDrawerEvents
+    MessageDrawerEvents,
+    Aria
 ) {
 
     /* @var {object} routes Message drawer route elements and callbacks. */
@@ -112,15 +114,15 @@ function(
                         element.attr('data-from-panel', true);
                     }
                     element.removeClass('hidden');
-                    element.attr('aria-hidden', false);
+                    Aria.unhide(element.get());
                 } else {
                     // For the message index page elements in the left panel should not be hidden.
                     if (!element.attr('data-in-panel')) {
                         element.addClass('hidden');
-                        element.attr('aria-hidden', true);
+                        Aria.hide(element.get());
                     } else if (newRoute == 'view-search' || newRoute == 'view-overview') {
                         element.addClass('hidden');
-                        element.attr('aria-hidden', true);
+                        Aria.hide(element.get());
                     }
                 }
             });
index 3f24f26..ed6d1b7 100644 (file)
@@ -33,7 +33,8 @@ define(
     'core/str',
     'core/templates',
     'core/user_date',
-    'core_message/message_drawer_view_conversation_constants'
+    'core_message/message_drawer_view_conversation_constants',
+    'core/aria',
 ],
 function(
     $,
@@ -41,7 +42,8 @@ function(
     Str,
     Templates,
     UserDate,
-    Constants
+    Constants,
+    Aria
 ) {
     var SELECTORS = Constants.SELECTORS;
     var TEMPLATES = Constants.TEMPLATES;
@@ -510,8 +512,7 @@ function(
     var showConfirmDialogueContainer = function(root) {
         var container = getConfirmDialogueContainer(root);
         var siblings = container.siblings(':not(.hidden)');
-        siblings.attr('aria-hidden', true);
-        siblings.attr('tabindex', -1);
+        Aria.hide(siblings.get());
         siblings.attr('data-confirm-dialogue-hidden', true);
 
         container.removeClass('hidden');
@@ -525,8 +526,7 @@ function(
     var hideConfirmDialogueContainer = function(root) {
         var container = getConfirmDialogueContainer(root);
         var siblings = container.siblings('[data-confirm-dialogue-hidden="true"]');
-        siblings.removeAttr('aria-hidden');
-        siblings.removeAttr('tabindex');
+        Aria.unhide(siblings.get());
         siblings.removeAttr('data-confirm-dialogue-hidden');
 
         container.addClass('hidden');
@@ -669,26 +669,29 @@ function(
                 var retry = element.find(SELECTORS.RETRY_SEND);
 
                 loading.addClass('hidden');
-                loading.attr('aria-hidden', 'true');
+                Aria.hide(loading.get());
+
                 time.addClass('hidden');
-                time.attr('aria-hidden', 'true');
+                Aria.hide(time.get());
+
                 retry.addClass('hidden');
-                retry.attr('aria-hidden', 'true');
+                Aria.hide(retry.get());
+
                 element.removeClass('border border-danger');
 
                 switch (after.sendState) {
                     case 'pending':
                         loading.removeClass('hidden');
-                        loading.attr('aria-hidden', 'false');
+                        Aria.unhide(loading.get());
                         break;
                     case 'error':
                         retry.removeClass('hidden');
-                        retry.attr('aria-hidden', 'false');
+                        Aria.unhide(retry.get());
                         element.addClass('border border-danger');
                         break;
                     case 'sent':
                         time.removeClass('hidden');
-                        time.attr('aria-hidden', 'false');
+                        Aria.unhide(time.get());
                         break;
                 }
             }
@@ -703,11 +706,11 @@ function(
 
                 if (after.errorMessage) {
                     messageContainer.removeClass('hidden');
-                    messageContainer.attr('aria-hidden', 'false');
+                    Aria.unhide(messageContainer.get());
                     message.text(after.errorMessage);
                 } else {
                     messageContainer.addClass('hidden');
-                    messageContainer.attr('aria-hidden', 'true');
+                    Aria.unhide(messageContainer.get());
                     message.text('');
                 }
             }
@@ -1003,11 +1006,11 @@ function(
 
         if (show) {
             container.removeClass('hidden');
-            container.attr('aria-hidden', false);
+            Aria.unhide(container.get());
             container.find(SELECTORS.EMOJI_PICKER_SEARCH_INPUT).focus();
         } else {
             container.addClass('hidden');
-            container.attr('aria-hidden', true);
+            Aria.hide(container.get());
         }
     };
 
@@ -1024,10 +1027,10 @@ function(
 
         if (show) {
             container.removeClass('hidden');
-            container.attr('aria-hidden', false);
+            Aria.unhide(container.get());
         } else {
             container.addClass('hidden');
-            container.attr('aria-hidden', true);
+            Aria.hide(container.get());
         }
     };
 
index f7469f2..bc8b1a7 100644 (file)
Binary files a/theme/boost/amd/build/drawer.min.js and b/theme/boost/amd/build/drawer.min.js differ
index 287b576..17fb4f5 100644 (file)
Binary files a/theme/boost/amd/build/drawer.min.js.map and b/theme/boost/amd/build/drawer.min.js.map differ
index 45b0391..160f14c 100644 (file)
@@ -20,8 +20,8 @@
  * @copyright  2016 Damyon Wiese
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-define(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub'],
-     function($, CustomEvents, Log, PubSub) {
+define(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub', 'core/aria'],
+     function($, CustomEvents, Log, PubSub, Aria) {
 
     var SELECTORS = {
         TOGGLE_REGION: '[data-region="drawer-toggle"]',
@@ -87,7 +87,7 @@ define(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub'],
 
             trigger.attr('aria-expanded', 'false');
             body.removeClass('drawer-open-' + side);
-            drawer.attr('aria-hidden', 'true');
+            Aria.hide(drawer.get());
             drawer.addClass('closed');
             if (!small) {
                 M.util.set_user_preference(preference, 'false');
@@ -117,7 +117,7 @@ define(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub'],
         if (!open) {
             // Open.
             trigger.attr('aria-expanded', 'true');
-            drawer.attr('aria-hidden', 'false');
+            Aria.unhide(drawer.get());
             drawer.focus();
             body.addClass('drawer-open-' + side);
             drawer.removeClass('closed');
@@ -129,7 +129,8 @@ define(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub'],
             body.removeClass('drawer-open-' + side);
             trigger.attr('aria-expanded', 'false');
             drawer.addClass('closed').delay(500).queue(function() {
-                $(this).attr('aria-hidden', 'true').dequeue();
+                Aria.hide(this);
+                $(this).dequeue();
             });
             if (!small) {
                 M.util.set_user_preference(preference, 'false');
@@ -183,7 +184,8 @@ define(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub'],
         // to either an open or closed state.
         $(SELECTORS.DRAWER).on('webkitTransitionEnd msTransitionEnd transitionend', function(e) {
             var drawer = $(e.target).closest(SELECTORS.DRAWER);
-            var open = drawer.attr('aria-hidden') == 'false';
+            // Note: aria-hidden is either present, or absent. It should not be set to false.
+            var open = !!drawer.attr('aria-hidden');
             PubSub.publish('nav-drawer-toggle-end', open);
         });
     };