diff --git a/app/javascript/dashboard/components-next/taginput/TagInput.vue b/app/javascript/dashboard/components-next/taginput/TagInput.vue index b48823d94..22db61fc1 100644 --- a/app/javascript/dashboard/components-next/taginput/TagInput.vue +++ b/app/javascript/dashboard/components-next/taginput/TagInput.vue @@ -119,7 +119,7 @@ const addTag = async () => { return; } - if (props.type === 'email' && props.allowCreate) { + if (props.type === 'email' || props.allowCreate) { if (!(await v$.value.$validate())) return; emitDataOnAdd(trimmedTag); } @@ -157,6 +157,13 @@ const handleFocus = () => { isFocused.value = true; }; +const handleKeydown = event => { + if (event.key === ',') { + event.preventDefault(); + addTag(); + } +}; + const handleClickOutside = () => { if (tags.value.length) isFocused.value = false; emit('onClickOutside'); @@ -218,6 +225,7 @@ const handleBlur = e => emit('blur', e); @focus="handleFocus" @input="handleInput" @blur="handleBlur" + @keydown="handleKeydown" />