ngx-quill-editor
ngx-quill-editor copied to clipboard
Changing options.readOnly doesn't enable/disable quill
trafficstars
The problem is here:
ngOnChanges(changes: SimpleChanges) {
if (changes['readOnly'] && this.quillEditor) {
this.quillEditor.enable(!changes['readOnly'].currentValue);
}
}
This solution works for me:
ngOnChanges(changes: SimpleChanges) {
if (!changes.options || changes.options.firstChange || !this.quillEditor)
return
this.quillEditor.enable(!changes.options.currentValue.readOnly);
}
it might be safer to directly use quill's isEnabled function here to check, not sure how tightly aligned the readOnly value is with the enabled/disabled state