This commit is contained in:
j3d1 2024-06-06 22:50:19 +02:00
parent dc97fabdff
commit 3407342a95

View file

@ -25,7 +25,7 @@ export default {
methods: { methods: {
rawhtml(value) { rawhtml(value) {
if (typeof this.format === 'function') { if (typeof this.format === 'function') {
return this.format(value); return this.format(value.replace(/ /g, ' '));
} else { } else {
return value; return value;
} }
@ -39,7 +39,7 @@ export default {
this.selection.direction = sel.direction; this.selection.direction = sel.direction;
this.selection.type = sel.type; this.selection.type = sel.type;
} }
this.$emit('input', event.target.innerText); this.$emit('input', event.target.innerText.replace(/ /g, ' '));
}, },
calculateOffset(container, node, offset) { calculateOffset(container, node, offset) {
let position = 0; let position = 0;
@ -91,8 +91,6 @@ export default {
watch: { watch: {
value() { value() {
if (this.selection) { if (this.selection) {
console.log(this.selection);
const div = this.$refs.text; const div = this.$refs.text;
div.innerHTML = this.rawhtml(this.value); div.innerHTML = this.rawhtml(this.value);
@ -103,8 +101,6 @@ export default {
sel.removeAllRanges(); sel.removeAllRanges();
sel.addRange(range); sel.addRange(range);
console.log(range, sel);
} }
} }
}, },