Commit 4b75fcb7 authored by Doris Tam's avatar Doris Tam
Browse files

Bug 1903933: Change the condition for collapsing from on blur to on keyup

This is so we are still able to expand the last submenu without it collapsing
by clicking on the arrow (last menu item) rather than collapsing the menu
when removing focus from it (what was the last menu item before expanding it).

Change-Id: Ie8920b1731b41e3db5f943d50f43642608885dc2
parent 7ce0fe80
......@@ -1206,11 +1206,12 @@ jQuery(function($) {
// Returns focus back to the menu button when the menu is closed
$('nav .navbar-collapse').on('', function(e) {
if (!$('child-nav collapse show')) {
var id = $(this).attr('id');
$('button[aria-controls=' + id + ']').focus();
// Return focus to the menu button on pressing esc on nav
$('nav .navbar-collapse').on('keyup', function(e) {
if (e.keyCode == 27) {
var parent = $(this);
var id = $(parent).attr('id');
$('button[aria-controls="' + id + '"]').focus();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment