Skip to content

Commit

Permalink
Remove tab logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Apr 19, 2024
1 parent 47f3018 commit ad9858b
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
GroupMap,
getUniqueId,
} from "./type-utils";
import { getString } from "@app/utils/utils";

interface AutocompleteLogicProps {
options: AnyAutocompleteOptionProps[];
Expand Down Expand Up @@ -86,7 +85,7 @@ export const useAutocompleteHandlers = ({

const handleKeyDown = (event: React.KeyboardEvent) => {
switch (event.key) {
case "nter":
case "enter":
if (tabSelectedItemId) {
addSelectionByItemId(tabSelectedItemId);
setTabSelectedItemId(null);
Expand All @@ -97,14 +96,6 @@ export const useAutocompleteHandlers = ({
setMenuIsOpen(false);
break;
case "Tab":
if (allOptions.length > 0) {
const firstOption = allOptions[0];
setInputValue(getString(firstOption.name));
setTabSelectedItemId(getUniqueId(firstOption));
event.preventDefault();
}

setMenuIsOpen(false);
break;

case "ArrowUp":
Expand Down

0 comments on commit ad9858b

Please sign in to comment.