fix(header-search): "Escape" should close empty search bar

This commit is contained in:
metonym 2023-11-21 10:14:14 -08:00
commit ad7380523d

View file

@ -115,6 +115,11 @@
} }
break; break;
case 'Escape': case 'Escape':
if (value === '') {
// If the search bar is empty, close it.
active = false;
}
// Reset the search query but keep the search bar active. // Reset the search query but keep the search bar active.
// Do not dispatch "clear" event as that should fire only on the "x" button. // Do not dispatch "clear" event as that should fire only on the "x" button.
value = ''; value = '';