tinymce / tinymce-angular

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

[disabled]="true" not working with angular v15. #348

Open ProfessionProgrammer opened 1 year ago

ProfessionProgrammer commented 1 year ago

What is the current behavior? [disabled]="true" not working with angular v15. Before upgrading to 15, I was using angular 14, where it was working as excpected. only changes i have done is upgrade angular to v15.

228778871-41d42e77-1ff8-47ba-bfbe-25bc61b834a1

Please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox.io or similar. 228779182-d7054bff-76f9-4df7-8a9e-a6ebb58e0cc2

228779940-1b0ec41c-2035-42d4-8335-3185b0d549c7

What is the expected behavior?

Which versions of TinyMCE/TinyMCE-Angular, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or TinyMCE-Angular?

228755251-019f61c3-b37d-42ad-b0e2-6b17594a0cb9

image

exalate-issue-sync[bot] commented 1 year ago

Ref: INT-3171

SherifMoShalaby commented 1 year ago

+1 Am having the same issue

emekaelo commented 1 year ago

There was an issue in angular v15 regarding disable not working in template. This link may help https://github.com/angular/angular/issues/48350#issuecomment-1400971435

timrasche commented 1 year ago

This doesnt work in angular 16 also...

dezsiszabi commented 10 months ago

I was able to fix this by adding a <form> tag around the <editor></editor> and setting the name attribute on the editor. For example:

<form>
  <editor name="editor"
          [(ngModel)]="model.value"
          [init]="editorOptions"
          [disabled]="true">
  </editor>
</form>

This works for me.

MircoEnnova commented 9 months ago

For me it was not possible to add a <form> tag. A temporary solution is using editable_root property.

<editor [init] = "{
    ...
    editable_root: false,
    ...
}"
</editor>

This works only on init and cannot be changed though. But for my needs it's good enough..