tab autocomplete for slash commands

This commit is contained in:
Nate Sesti 2023-06-15 20:50:52 -07:00
parent f4664228b0
commit ccca93eb18

View file

@ -113,6 +113,9 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
(event.nativeEvent as any).preventDownshiftDefault = true;
if (props.onEnter) props.onEnter(event);
setInputValue("");
} else if (event.key === "Tab" && items.length > 0) {
setInputValue(items[0].name);
event.preventDefault();
}
},
ref: ref as any,