diff --git a/frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue b/frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue
index bc2ef4a6fc..633be6ec53 100644
--- a/frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue
+++ b/frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue
@@ -208,6 +208,7 @@
this.handleInputBlur()
}
}
+ divInputDom.addEventListener('paste', this.handlePaste)
},
beforeDestroy () {
window.removeEventListener('click', this.handleListShow, false)
@@ -476,6 +477,28 @@
handleBlur () {
this.emit_event(this.tagCode, 'blur', this.value)
this.$emit('blur', this.value)
+ },
+ handlePaste (e) {
+ event.preventDefault()
+ let text = ''
+ const clp = (e.originalEvent || e).clipboardData
+ if (clp === undefined || clp === null) {
+ text = window.clipboardData.getData('text') || ''
+ text = text.split('\n').join('')
+ if (text !== '') {
+ if (window.getSelection) {
+ const newNode = document.createElement('span')
+ newNode.innerHTML = text
+ window.getSelection().getRangeAt(0).insertNode(newNode)
+ } else {
+ document.selection.createRange().pasteHTML(text)
+ }
+ }
+ } else {
+ text = clp.getData('text/plain') || ''
+ text = text.split('\n').join('')
+ text && document.execCommand('insertText', false, text)
+ }
}
}
}
diff --git a/frontend/desktop/src/components/common/RenderForm/tags/TagTextarea.vue b/frontend/desktop/src/components/common/RenderForm/tags/TagTextarea.vue
index f3588658aa..f29bbb0683 100644
--- a/frontend/desktop/src/components/common/RenderForm/tags/TagTextarea.vue
+++ b/frontend/desktop/src/components/common/RenderForm/tags/TagTextarea.vue
@@ -167,6 +167,7 @@
divInputDom.innerHTML = divInputDom.innerHTML.replace(/
/g, '