Skip to content

Commit 325718c

Browse files
authored
Merge pull request #18 from mononen/main
I didn't do tab completion correctly last time. This actually works now :)
2 parents 95160d4 + 4473469 commit 325718c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

packages/omniviewdev-ui/src/inputs/Select.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ export default function Select({
112112
return;
113113
}
114114

115+
if (e.key === "Tab") {
116+
e.preventDefault();
117+
e.stopPropagation();
118+
if (filteredOptions.length === 0) return;
119+
const next = focusedIndex + 1;
120+
setFocusedIndex(next >= filteredOptions.length ? 0 : next);
121+
return;
122+
}
123+
115124
if (
116125
e.key === "Enter" &&
117126
focusedIndex >= 0 &&

0 commit comments

Comments
 (0)