diff --git a/components/neroshitron/search_input.tsx b/components/neroshitron/search_input.tsx index 6225c03..69247b3 100644 --- a/components/neroshitron/search_input.tsx +++ b/components/neroshitron/search_input.tsx @@ -72,6 +72,13 @@ const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnable const newIndex = currentIndex === tags.length - 1 ? 0 : currentIndex + 1; setCurrentTag(tags[newIndex].name); } + else if(event.key === 'Enter'){ + const currentIndex = tags.findIndex(tag => tag.name === currentTag); + setSelectedTags([...selectedTags, tags[currentIndex].name]); + const tagsInput = selectedTagsInput; + tagsInput.push({value: tags[currentIndex].name, label: tags[currentIndex].name}); + setSelectedTagsInput(tagsInput); + } }; window.addEventListener('keydown', handleKeyDown);