Skip to content

Commit

Permalink
XWIKI-18007: Drawer menu improvements for accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
wthrajat committed Feb 4, 2023
1 parent 61c80b4 commit 3a9d056
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ require(['jquery', 'iscroll', 'drawer'], function($, IScroll) {
$('#tmDrawerActivator').attr('aria-expanded', 'false');
});
});
// Drawer can be closed by pressing the ESC key, irrespective of how you opened it (i.e., using keyboard or by clicking it)
// Drawer can be closed by pressing the ESC key, irrespective of how you opened it (by using keyboard or by clicking it)
$(document).on('keydown', function (event) {
if (event.keyCode === 27) { // 27 is the key code for the ESC key
$('.drawer-nav').closest('body').drawer('close');}
if (event.key === 'Escape') {
$('.drawer-nav').closest('body').drawer('close');}
});
});
##
Expand Down

0 comments on commit 3a9d056

Please sign in to comment.