From 3a2a6328b026a1945b00d5421f32d4168b9aaad9 Mon Sep 17 00:00:00 2001 From: jedi Date: Thu, 6 Jun 2024 21:08:57 +0200 Subject: [PATCH] stash --- web/src/components/inputs/FormatedText.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/components/inputs/FormatedText.vue b/web/src/components/inputs/FormatedText.vue index 60ff865..80940f5 100644 --- a/web/src/components/inputs/FormatedText.vue +++ b/web/src/components/inputs/FormatedText.vue @@ -90,12 +90,15 @@ export default { value() { if (this.selection) { const div = this.$refs.text; + const sel = window.getSelection(); + sel.removeAllRanges(); const range = document.createRange(); console.log(this.selection); range.setStart(...this.findNode(div, this.selection.start)); range.setEnd(...this.findNode(div, this.selection.end)); - this.selection.removeAllRanges(); - this.selection.addRange(range); + sel.addRange(range); + //this.selection.removeAllRanges(); + //this.selection.addRange(range); } } }