From 53b35d0ee2ab0f52c8c1259bcf4db82d120eddca Mon Sep 17 00:00:00 2001 From: jedi Date: Thu, 23 May 2024 00:39:22 +0200 Subject: [PATCH] stash --- web/src/components/inputs/FormatedText.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/components/inputs/FormatedText.vue b/web/src/components/inputs/FormatedText.vue index 80f3d72..a3a1a30 100644 --- a/web/src/components/inputs/FormatedText.vue +++ b/web/src/components/inputs/FormatedText.vue @@ -1,6 +1,5 @@ @@ -41,8 +40,9 @@ export default { if (this.selection) { const div = this.$refs.text; const range = document.createRange(); - range.setStart(div.childNodes[0], Math.min(this.selection.anchorOffset, div.childNodes[0].length)); - range.setEnd(div.childNodes[0], Math.min(this.selection.focusOffset, div.childNodes[0].length)); + console.log(this.selection.anchorOffset, this.selection.focusOffset); + range.setStart(div, Math.min(this.selection.anchorOffset, div.childNodes[0].length)); + range.setEnd(div, Math.min(this.selection.focusOffset, div.childNodes[0].length)); this.selection.removeAllRanges(); this.selection.addRange(range); }