Skip to content
Snippets Groups Projects
Unverified Commit 1af77eaf authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3209125 by tushar_sachdeva, aaron.ferris, kishor_kolekar, paulocs,...

Issue #3209125 by tushar_sachdeva, aaron.ferris, kishor_kolekar, paulocs, KapilV, Abhijith S, Sakthivel M, mherchel: Olivero: Desktop search form should close when ESC key is pressed
parent 3296fcb5
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,12 @@
Drupal.olivero.toggleSearchVisibility = toggleSearchVisibility;
document.addEventListener('keyup', (e) => {
if (e.key === 'Escape' || e.key === 'Esc') {
toggleSearchVisibility(false);
}
});
document.addEventListener('click', (e) => {
if (
e.target.matches(
......
......@@ -38,6 +38,11 @@
}
Drupal.olivero.toggleSearchVisibility = toggleSearchVisibility;
document.addEventListener('keyup', function (e) {
if (e.key === 'Escape' || e.key === 'Esc') {
toggleSearchVisibility(false);
}
});
document.addEventListener('click', function (e) {
if (e.target.matches('.header-nav__search-button, .header-nav__search-button *')) {
toggleSearchVisibility(!searchIsVisible());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment