chore: Minor fix

This commit is contained in:
iamsivin
2024-11-20 17:03:50 +05:30
parent 8f7589f173
commit e46d704573
@@ -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"