chore: Minor fix
This commit is contained in:
@@ -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"
|
||||
/>
|
||||
<DropdownMenu
|
||||
v-if="showDropdownMenu"
|
||||
|
||||
Reference in New Issue
Block a user