mirror of
https://github.com/D4M13N-D3V/neroshitron.git
synced 2025-07-05 06:29:19 +00:00
Update search_input.tsx
This commit is contained in:
parent
386927406c
commit
576063ffe9
@ -72,6 +72,13 @@ const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnable
|
|||||||
const newIndex = currentIndex === tags.length - 1 ? 0 : currentIndex + 1;
|
const newIndex = currentIndex === tags.length - 1 ? 0 : currentIndex + 1;
|
||||||
setCurrentTag(tags[newIndex].name);
|
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);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user