Skip to content

Commit

Permalink
fix: keyboard nav in searchbar
Browse files Browse the repository at this point in the history
Signed-off-by: Urban Vidovič <[email protected]>
  • Loading branch information
pseudobun committed Jun 24, 2024
1 parent 4534e24 commit afca7f4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/dapp/src/components/Navbar/Searchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ export const Searchbar = () => {
}
// escape
if (e.keyCode === 27) {
if (activeIndex === -1) {
setSuggestions(SUGGESTED_ACCOUNTS);
setQuery('');
} else {
setActiveIndex(-1);
setQuery('');
}
setSuggestions(SUGGESTED_ACCOUNTS);
setQuery('');
setShowDropdown(false);
inputRef?.current?.blur();
}
// up
if (e.keyCode === 38 || (e.shiftKey && e.keyCode === 9)) {
Expand Down

0 comments on commit afca7f4

Please sign in to comment.