fix(Text Editor): Clear editor when value is falsy
This commit is contained in:
parent
34064a322f
commit
ee0b116954
1 changed files with 7 additions and 1 deletions
|
|
@ -102,8 +102,14 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
|
|||
},
|
||||
|
||||
set_formatted_input(value) {
|
||||
if (!(this.quill && value)) return;
|
||||
if (!this.quill) return;
|
||||
if (value === this.get_input_value()) return;
|
||||
if (!value) {
|
||||
// clear contents for falsy values like '', undefined or null
|
||||
this.quill.setText('');
|
||||
return;
|
||||
}
|
||||
|
||||
this.quill.setText('');
|
||||
this.quill.clipboard.dangerouslyPasteHTML(0, value);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue