Rollup merge of #47202 - GuillaumeGomez:fix-defocus, r=QuietMisdreavus

Fix search bar defocus

Fixes #47134.

r? @QuietMisdreavus
This commit is contained in:
Guillaume Gomez 2018-01-06 02:13:35 +01:00 committed by GitHub
commit b3104178d6
1 changed files with 4 additions and 0 deletions

View File

@ -1132,6 +1132,10 @@
e.preventDefault();
} else if (e.which === 16) { // shift
// Does nothing, it's just to avoid losing "focus" on the highlighted element.
} else if (e.which === 27) { // escape
removeClass(actives[currentTab][0], 'highlighted');
document.getElementsByClassName('search-input')[0].value = '';
defocusSearchBar();
} else if (actives[currentTab].length > 0) {
removeClass(actives[currentTab][0], 'highlighted');
}