From 98366c89096b019d33dfc3e5ed0bd60d99263683 Mon Sep 17 00:00:00 2001 From: jedi Date: Thu, 23 May 2024 00:04:45 +0200 Subject: [PATCH] stash --- web/src/components/inputs/FormatedText.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/inputs/FormatedText.vue b/web/src/components/inputs/FormatedText.vue index 9aaf592..0771915 100644 --- a/web/src/components/inputs/FormatedText.vue +++ b/web/src/components/inputs/FormatedText.vue @@ -42,7 +42,7 @@ export default { const div = this.$refs.text; const range = document.createRange(); range.setStart(div.childNodes[0], this.selection.anchorOffset); - range.setEnd(div.childNodes[0], this.selection.focusOffset); + range.setEnd(div.childNodes[0], Math.min(this.selection.anchorOffset, div.childNodes[0].length)); this.selection.removeAllRanges(); this.selection.addRange(range); }