@fy-/fws-vue 2.3.33 → 2.3.35
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.
|
@@ -260,24 +260,31 @@ function focusInput() {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
/**
|
|
263
|
-
* Handle pasting text
|
|
263
|
+
* Handle pasting text - without debounce for direct response
|
|
264
264
|
*/
|
|
265
|
-
|
|
265
|
+
function handlePaste(e: ClipboardEvent) {
|
|
266
266
|
if (!textInput.value || isMaxReached.value) return
|
|
267
267
|
|
|
268
|
-
|
|
268
|
+
// Prevent the default paste behavior
|
|
269
|
+
e.preventDefault()
|
|
270
|
+
|
|
271
|
+
// Get clipboard data
|
|
272
|
+
const clipboardData = e.clipboardData
|
|
269
273
|
if (!clipboardData) return
|
|
270
274
|
|
|
275
|
+
// Get the pasted text
|
|
271
276
|
const text = clipboardData.getData('text')
|
|
272
|
-
if (!text.trim()) return
|
|
277
|
+
if (!text || !text.trim()) return
|
|
273
278
|
|
|
274
|
-
|
|
279
|
+
// Process the text (replace separator characters)
|
|
280
|
+
const pasteText = text.replace(/[,;]/g, ',')
|
|
275
281
|
|
|
276
|
-
//
|
|
282
|
+
// Simply set the content - the most reliable approach
|
|
277
283
|
textInput.value.textContent = pasteText
|
|
278
|
-
|
|
284
|
+
|
|
285
|
+
// Add tags immediately
|
|
279
286
|
addTag()
|
|
280
|
-
}
|
|
287
|
+
}
|
|
281
288
|
|
|
282
289
|
/**
|
|
283
290
|
* Handle keyboard navigation between tags - optimized with element lookup caching
|