This commit is contained in:
j3d1 2024-06-06 21:08:57 +02:00
parent db3be4f5bc
commit f0a855b68c

View file

@ -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);
}
}
}