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

This commit is contained in:
metonym 2023-11-21 10:17:19 -08:00 committed by GitHub
commit e667352329
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 = '';