The previous code unconditionally captured up and down arrow keys
for use in search result navigation. This change fixes this by making
the search code only capture arrow keys when search results are
visible and present.
The apparently redundant check for 'd-none' and focusableSuggestions
length is needed because suggestions can still exist when the user
enters a search term with matches but then clicks out of the search
box while leaving the search term in it.
The previous code unconditionally captured up and down arrow keys for use in search result navigation. This change fixes this by making the search code only capture arrow keys when search results are visible and present.
The apparently redundant check for 'd-none' and focusableSuggestions length is needed because suggestions can still exist when the user enters a search term with matches but then clicks out of the search box while leaving the search term in it.
Fixes #21