Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

Changing options.readOnly doesn't enable/disable quill #60

Open
damianaiamad opened this issue Jul 2, 2018 · 1 comment
Open

Changing options.readOnly doesn't enable/disable quill #60

damianaiamad opened this issue Jul 2, 2018 · 1 comment

Comments

@damianaiamad
Copy link

damianaiamad commented Jul 2, 2018

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);
  }

@padraigfl
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants