Fix keyboard nav inside search input

This commit is contained in:
shamoon 2024-04-02 13:55:54 -07:00
parent 9113d718d8
commit 8faf449b7c

View File

@ -58,7 +58,11 @@ export class GlobalSearchComponent {
this.searchInput.nativeElement.focus() this.searchInput.nativeElement.focus()
} }
if (this.searchResults && this.resultsDropdown.isOpen()) { if (
this.searchResults &&
this.resultsDropdown.isOpen() &&
document.activeElement !== this.searchInput.nativeElement
) {
if (event.key === 'ArrowDown') { if (event.key === 'ArrowDown') {
if (this.currentItemIndex < this.searchResults.total - 1) { if (this.currentItemIndex < this.searchResults.total - 1) {
this.currentItemIndex++ this.currentItemIndex++