Skip to content

Commit

Permalink
fix(command box): clear. input when submitting
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMcIntosh committed Feb 20, 2024
1 parent 7c99e88 commit 943f200
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ComboBox/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export const ComboBox: React.FC<ComboBoxProps> = ({
_onChange(value);
};

const handleSubmit: ComboBoxProps["onSubmit"] = (event) => {
undoRedo.setState("");
onSubmit(event);
};

const commandsOrArguments = selectedCommand
? commandArguments.map((arg) => selectedCommand + arg)
: commands;
Expand Down Expand Up @@ -177,7 +182,7 @@ export const ComboBox: React.FC<ComboBoxProps> = ({
) {
event.preventDefault();
event.stopPropagation();
onSubmit(event);
handleSubmit(event);
setStartPosition(null);
setTrigger("");
combobox.hide();
Expand Down

0 comments on commit 943f200

Please sign in to comment.