From 0b4e345ad6cc26c12cfec69b5de818e2e117043b Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Thu, 18 Jul 2024 10:58:12 +0300 Subject: [PATCH] fix on paste --- app/javascript/template_builder/area.vue | 2 +- app/javascript/template_builder/contenteditable.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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()