@fy-/fws-vue 0.3.32 → 0.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -131,9 +131,9 @@ defineExpose({ focus, blur, getInputRef });
|
|
|
131
131
|
>
|
|
132
132
|
<label
|
|
133
133
|
:for="id"
|
|
134
|
-
v-if="label
|
|
134
|
+
v-if="label"
|
|
135
135
|
class="block mb-2 text-sm font-medium text-fv-neutral-900 dark:text-white"
|
|
136
|
-
>{{ label
|
|
136
|
+
>{{ label }}
|
|
137
137
|
</label>
|
|
138
138
|
<input
|
|
139
139
|
ref="inputRef"
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
ref="textInput"
|
|
32
32
|
@input="handleInput"
|
|
33
33
|
@paste.prevent="handlePaste"
|
|
34
|
+
@keydown.prevent="handleKeydown"
|
|
34
35
|
placeholder="Add a tag..."
|
|
35
36
|
></div>
|
|
36
37
|
</div>
|
|
@@ -126,6 +127,13 @@ const handlePaste = (e: any) => {
|
|
|
126
127
|
e.preventDefault();
|
|
127
128
|
addTag();
|
|
128
129
|
};
|
|
130
|
+
const handleKeydown = (event: KeyboardEvent) => {
|
|
131
|
+
if (!textInput.value) return;
|
|
132
|
+
|
|
133
|
+
if (event.key === "Backspace" && textInput.value.innerText) {
|
|
134
|
+
textInput.value.innerText = textInput.value.innerText.slice(0, -1);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
129
137
|
</script>
|
|
130
138
|
|
|
131
139
|
<style scoped>
|