Skip to content

feat(MatCheckboxModule): add an option to toggle() to mark control as dirty/non-pristine #21029

@NorseJedi

Description

@NorseJedi

Reproduction

Steps to reproduce:

Programatically change a MatCheckbox in the component typescript-file using the toggle() method

See https://stackblitz.com/edit/angular-ivy-a5lgux

Expected Behavior

The checkbox (and the form) should be marked as dirty=true and pristine=false.

Actual Behavior

The checkbox (and form) remains unchanged marked as pristine=true and dirty=false.

Environment

  • Angular: 10.2.3
  • CDK/Material: 10.2.6 (also tested with 11.0.0)
  • Browser(s): Chrome 86.0.4240.193 (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu 20.10 WSL in Windows 10

Metadata

Metadata

Assignees

Labels

P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: material/checkboxfeatureThis issue represents a new feature or feature request rather than a bug or bug fixneeds: discussionFurther discussion with the team is needed before proceeding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions