Skip to content

Editor Value Does Not Update When FormControl Value Changes via patchValue (Reactive Forms) #4678

@yanmariomenev

Description

@yanmariomenev

Description

The editor in the reactive forms example does not reflect updates when the related FormControl value is changed using the patchValue method.

Steps To Reproduce

https://stackblitz.com/edit/angular-n6hrhfsc-fnzsfszp?file=src%2Fapp%2Fapp.component.ts

  1. Change the text in the first editor (reactive forms).
  2. Click the "Set default" button.
  3. The FormControl value updates, but the editor content stays the same.
  4. Repeat the steps with the second editor (template-driven forms).

The editor updates correctly in this case.

Workaround

Reset the from and then patch the value:
https://stackblitz.com/edit/angular-n6hrhfsc-cuwymaal?file=src%2Fapp%2Fapp.component.ts

    this.myForm.controls.editor.reset();
    this.myForm.controls.editor.patchValue(this.default)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions