diff --git a/app/javascript/template_builder/area.vue b/app/javascript/template_builder/area.vue index 9465cb7d..143b78d0 100644 --- a/app/javascript/template_builder/area.vue +++ b/app/javascript/template_builder/area.vue @@ -575,7 +575,7 @@ export default { onPaste (e) { const text = (e.clipboardData || window.clipboardData).getData('text/plain') - const selection = window.getSelection() + const selection = this.$el.getRootNode().getSelection() if (selection.rangeCount) { selection.deleteFromDocument() diff --git a/app/javascript/template_builder/contenteditable.vue b/app/javascript/template_builder/contenteditable.vue index 9b478694..44715c20 100644 --- a/app/javascript/template_builder/contenteditable.vue +++ b/app/javascript/template_builder/contenteditable.vue @@ -101,7 +101,7 @@ export default { onPaste (e) { const text = (e.clipboardData || window.clipboardData).getData('text/plain') - const selection = window.getSelection() + const selection = this.$el.getRootNode().getSelection() if (selection.rangeCount) { selection.deleteFromDocument()