diff --git a/web/src/components/inputs/FormatedText.vue b/web/src/components/inputs/FormatedText.vue index 0771915..80f3d72 100644 --- a/web/src/components/inputs/FormatedText.vue +++ b/web/src/components/inputs/FormatedText.vue @@ -41,8 +41,8 @@ export default { if (this.selection) { const div = this.$refs.text; const range = document.createRange(); - range.setStart(div.childNodes[0], this.selection.anchorOffset); - range.setEnd(div.childNodes[0], Math.min(this.selection.anchorOffset, div.childNodes[0].length)); + 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)); this.selection.removeAllRanges(); this.selection.addRange(range); }