Fixed #204 - Editor infinite loop with some specific values
parent
10b08d12bc
commit
98414b7cec
|
@ -76,8 +76,12 @@ export default {
|
||||||
formats: this.formats
|
formats: this.formats
|
||||||
});
|
});
|
||||||
|
|
||||||
this.quill.on('text-change', (delta, source) => {
|
this.renderValue(this.value);
|
||||||
|
|
||||||
|
this.quill.on('text-change', (delta, oldContents, source) => {
|
||||||
|
if (source === 'user') {
|
||||||
let html = this.$refs.editorElement.children[0].innerHTML;
|
let html = this.$refs.editorElement.children[0].innerHTML;
|
||||||
|
let text = this.quill.getText().trim();
|
||||||
if (html === '<p><br></p>') {
|
if (html === '<p><br></p>') {
|
||||||
html = '';
|
html = '';
|
||||||
}
|
}
|
||||||
|
@ -85,13 +89,12 @@ export default {
|
||||||
this.$emit('input', html);
|
this.$emit('input', html);
|
||||||
this.$emit('text-change', {
|
this.$emit('text-change', {
|
||||||
htmlValue: html,
|
htmlValue: html,
|
||||||
textValue: this.quill.getText(),
|
textValue: text,
|
||||||
delta: delta,
|
delta: delta,
|
||||||
source: source
|
source: source
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.renderValue(this.value);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
renderValue(value) {
|
renderValue(value) {
|
||||||
|
|
Loading…
Reference in New Issue