@fy-/fws-vue 1.3.0 → 1.3.1

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.
@@ -63,12 +63,13 @@ const removeTag = (index: number) => {
63
63
  focusInput();
64
64
  };
65
65
 
66
+ /*
66
67
  const removeLastTag = () => {
67
- if (!import.meta.env.SSR) {
68
- if (!textInput.value) return;
69
- if (textInput.value.innerText === "") {
70
- model.value.pop();
71
- } else {
68
+ if (!textInput.value) return;
69
+ if (textInput.value.innerText === "") {
70
+ model.value.pop();
71
+ } else {
72
+ try {
72
73
  const currentLength = textInput.value.innerText.length;
73
74
  textInput.value.innerText = textInput.value.innerText.slice(0, -1);
74
75
 
@@ -79,9 +80,12 @@ const removeLastTag = () => {
79
80
  if (!sel) return;
80
81
  sel.removeAllRanges();
81
82
  sel.addRange(range);
83
+ } catch (e) {
84
+ console.error(e);
82
85
  }
83
86
  }
84
87
  };
88
+ */
85
89
  const focusInput = () => {
86
90
  if (!textInput.value) return;
87
91
 
@@ -89,17 +93,15 @@ const focusInput = () => {
89
93
  };
90
94
 
91
95
  const handlePaste = (e: any) => {
92
- if (!import.meta.env.SSR) {
93
- if (!textInput.value) return;
94
-
95
- // @ts-ignore
96
- const text = (e.clipboardData || window.clipboardData).getData("text");
97
- const separatorsRegex = new RegExp(props.separators.join("|"), "g");
98
- const pasteText = text.replace(separatorsRegex, ",");
99
- textInput.value.innerText += pasteText;
100
- e.preventDefault();
101
- addTag();
102
- }
96
+ if (!textInput.value) return;
97
+
98
+ // @ts-ignore
99
+ const text = (e.clipboardData || window.clipboardData).getData("text");
100
+ const separatorsRegex = new RegExp(props.separators.join("|"), "g");
101
+ const pasteText = text.replace(separatorsRegex, ",");
102
+ textInput.value.innerText += pasteText;
103
+ e.preventDefault();
104
+ addTag();
103
105
  };
104
106
  </script>
105
107
 
@@ -107,7 +109,6 @@ const handlePaste = (e: any) => {
107
109
  <ClientOnly
108
110
  :class="`tags-input ${$props.error ? 'error' : ''}`"
109
111
  @click="focusInput"
110
- @keydown.delete.prevent="removeLastTag"
111
112
  @keydown.enter.prevent="addTag"
112
113
  >
113
114
  <span
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {