fix: disallow creating empty tag

This commit is contained in:
Antonella Sgarlatta
2021-06-10 11:58:10 -03:00
parent 813228aa37
commit c4db37ff94

View File

@@ -47,7 +47,9 @@ export const AutocompleteTagInput = observer(({ appState }: Props) => {
const onFormSubmit = async (event: Event) => {
event.preventDefault();
await appState.noteTags.createAndAddNewTag();
if (autocompleteSearchQuery !== '') {
await appState.noteTags.createAndAddNewTag();
}
};
const onKeyDown = (event: KeyboardEvent) => {