Skip to content

Commit

Permalink
Make Tab / Shift+Tab select items in the tag selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Minnowo committed Sep 20, 2024
1 parent 6e75781 commit 95eea7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ui/src/tag/TagSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ export const TagSelector: React.FC<TagSelectorProps> = ({
setSelectedEntries(selectedEntries.slice(0, selectedEntries.length - 1));
setCurrentValue(event.ctrlKey ? '' : label(last));
}
if (event.key === 'ArrowUp') {
if (event.key === 'ArrowUp' || (event.key === 'Tab' && event.shiftKey && open)) {
event.preventDefault();
setHighlightedIndex(highlightedIndex === 0 ? suggestions.length - 1 : highlightedIndex - 1);
}
if (event.key === 'ArrowDown') {
} else if (event.key === 'ArrowDown' || (event.key === 'Tab' && open)) {
event.preventDefault();
setHighlightedIndex(highlightedIndex === suggestions.length - 1 ? 0 : highlightedIndex + 1);
}
Expand Down

0 comments on commit 95eea7a

Please sign in to comment.