This commit is contained in:
j3d1 2024-06-06 22:50:19 +02:00
parent 4d3e68079a
commit 7da64f0612

View file

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