Skip to content

Editor value cannot be reset manually when used in Angular Forms #3669

@mbechev

Description

@mbechev

Describe the bug
The value of the Editor cannot be reset multiple times when used in a Reactive and Template driven Form.

Trying to set an empty string through the built-in Form methods (setValue, patchValue), the Editor values don't seem to reflect the changes and cannot be reset.

Template driven:
https://user-images.githubusercontent.com/49076727/169473360-0ffe6049-15d5-4fa9-9005-f04961972c2e.mp4

To Reproduce
Reactive - https://stackblitz.com/edit/angular-qlotxv-dsak9w
Template driven - https://stackblitz.com/edit/angular-x8uhrs-nns2sc?file=src%2Fapp%2Fapp.component.ts

  1. Clear the initial value with the button.
  2. Type in the Editor.
  3. Clear the new value with the button.

If setting any truthy value through the Form methods, the Editor behaves as expected.

https://stackblitz.com/edit/angular-qlotxv-8tuccn

Workaround
Template driven:
https://stackblitz.com/edit/angular-x8uhrs-ekfxvb?file=src%2Fapp%2Fapp.component.ts

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions