diff --git a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/javascript.vm b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/javascript.vm index db1d24b94a7..6780ecdbb23 100644 --- a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/javascript.vm +++ b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/javascript.vm @@ -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');} }); }); ##