diff --git a/src/components/TagInput.tsx b/src/components/TagInput.tsx index a1e6ebf2..b5f6bc1d 100644 --- a/src/components/TagInput.tsx +++ b/src/components/TagInput.tsx @@ -136,15 +136,19 @@ export default function TagInput({ setInputText(''); break; case 'ArrowDown': - setSelectedOptionIndex(i => { - if (i === undefined) { - return 1; - } else if (i >= optionsFiltered.length - 1) { - return 0; - } else { - return i + 1; - } - }); + if (shouldShowMenu) { + setSelectedOptionIndex(i => { + if (i === undefined) { + return optionsFiltered.length > 1 ? 1 : 0; + } else if (i >= optionsFiltered.length - 1) { + return 0; + } else { + return i + 1; + } + }); + } else { + setShouldShowMenu(true); + } break; case 'ArrowUp': setSelectedOptionIndex(i => { @@ -275,7 +279,11 @@ export default function TagInput({ 'text-xl shadow-lg dark:shadow-xl', )} > - {optionsFiltered.map(({ value, annotation }, index) => + {optionsFiltered.map(({ + value, + annotation, + annotationAria, + }, index) =>