Skip to content

Commit

Permalink
feat: remove first item selection (#7596)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus authored Jul 16, 2024
1 parent 0a4ef3b commit 7d88b90
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions frontend/src/component/commandBar/CommandBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ export const CommandBar = () => {
debouncedSetSearchState(value);
}, [searchedFlagCount]);

useEffect(() => {
if (!searchLoading) {
selectFirstItem();
}
}, [searchLoading, searchString]);

const onSearchChange = (value: string) => {
debouncedSetSearchState(value);
setValue(value);
Expand Down Expand Up @@ -271,13 +265,6 @@ export const CommandBar = () => {
},
);

const selectFirstItem = () => {
const itemsAndIndex = findCommandBarLinksAndSelectedIndex();
if (!itemsAndIndex) return;
const { allCommandBarLinks } = itemsAndIndex;
(allCommandBarLinks[0] as HTMLElement).focus();
};

useOnClickOutside([searchContainerRef], hideSuggestions);
const onKeyDown = (event: React.KeyboardEvent) => {
if (event.key === 'Escape') {
Expand Down

0 comments on commit 7d88b90

Please sign in to comment.