tinymce / tinymce-angular

Official TinyMCE Angular Component
MIT License
327 stars 92 forks source link

Deprecated setMode method is called in 6.0.0 #290

Closed appimpact closed 2 years ago

appimpact commented 2 years ago

This is related to latest release of 6.0.0.

According to the official release notes here: https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/

"The execCallback and setMode methods and validate (undocumented) property have been deprecated in TinyMCE 5.10. For information on the deprecated methods, see: tinymce.Editor - methods."

However, in your component setMode is still called so it causes an error, effectively not allowing for disabled state to be set:

  @Input()
  public set disabled(val) {
    this._disabled = val;
    if (this._editor && this._editor.initialized) {
      this._editor.setMode(val ? 'readonly' : 'design');
    }
  }

This is very serious bug since disabled property of component is one of the crucial ones for proper component behavior.

According to the documentation instructions, appropriate fix would be to call this method instead:

this._editor.mode.set(mode)

exalate-issue-sync[bot] commented 2 years ago

Ref: INT-2849

jscasca commented 2 years ago

@appimpact Thank you for bringing this up. There was some confusion in a branch being merged. However, this has been fixed in version 6.0.1 which is now available on npm.