@fy-/fws-vue 0.3.45 → 0.3.47
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.
|
@@ -105,6 +105,17 @@ const removeLastTag = () => {
|
|
|
105
105
|
if (!textInput.value) return;
|
|
106
106
|
if (textInput.value.innerText === "") {
|
|
107
107
|
tags.value.pop();
|
|
108
|
+
} else {
|
|
109
|
+
const currentLength = textInput.value.innerText.length;
|
|
110
|
+
textInput.value.innerText = textInput.value.innerText.slice(0, -1);
|
|
111
|
+
|
|
112
|
+
const range = document.createRange();
|
|
113
|
+
const sel = window.getSelection();
|
|
114
|
+
range.selectNodeContents(textInput.value);
|
|
115
|
+
range.collapse(false);
|
|
116
|
+
if (!sel) return;
|
|
117
|
+
sel.removeAllRanges();
|
|
118
|
+
sel.addRange(range);
|
|
108
119
|
}
|
|
109
120
|
};
|
|
110
121
|
const focusInput = () => {
|
|
@@ -124,13 +135,6 @@ const handlePaste = (e: any) => {
|
|
|
124
135
|
e.preventDefault();
|
|
125
136
|
addTag();
|
|
126
137
|
};
|
|
127
|
-
const handleKeydown = (event: KeyboardEvent) => {
|
|
128
|
-
if (!textInput.value) return;
|
|
129
|
-
|
|
130
|
-
if (event.key === "Backspace" && textInput.value.innerText) {
|
|
131
|
-
textInput.value.innerText = textInput.value.innerText.slice(0, -1);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
138
|
</script>
|
|
135
139
|
|
|
136
140
|
<style scoped>
|