Skip to content

Disabled property ignored on initialization in template-driven forms #65

@fxab

Description

@fxab

Hey everyone 👋

the disabled property is being ignored during initialization when used with template-driven forms and ngModel. The editor remains editable even when the disabled property is set to true.

Already tried to fix it myself Ticket-Gretchen@0eddf53 based on the fix done in the TinyMCE repo tinymce/tinymce-angular@8a7e6db. But this did not seem to solve the problem.

What is the current behavior?

When using the editor component in template-driven forms like this:

<editor
  [id]="uuid"
  [init]="config"
  [disabled]="!mode().editable"
  [(ngModel)]="formValue?.infoText"
  (onFocusIn)="focus()"
  (onBlur)="blur()"
  (onChange)="onChange($event)"
></editor>

The editor is still editable when !mode().editable results in true.

Please provide the steps to reproduce.

  1. Create a template-driven form with the component
  2. Set the disabled property to true initially
  3. Observe that the editor is still interactive despite the disabled state

What is the expected behavior?

The editor component should respect the disabled property from the start and prevent any user interaction when disabled="true".

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

Tested with the following verions and browser:
"@hugerte/hugerte-angular": "^1.0.2"
"hugerte": "^1.0.9"
Google Chrome Version 138.0.7204.184

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions