Skip to content

Calling markAsTouched on a FormGroup doesn't affect children controls #12281

@jabas06

Description

@jabas06

**I'm submitting a bug report.

Current behavior
Calling markAsTouched on a FormGroup doesn't mark their children controls as touched.

Expected behavior
Calling markAsTouched on a FormGroup should set the touched flag of their children controls. Actually, the opposite method, markAsUntouched, is affecting the children controls.

Why markAsTouched doesn't work the same way?

Minimal reproduction of the problem with instructions
Repro:
http://plnkr.co/edit/CgjaYHgfzdEqCyTCud8N?p=preview

What is the motivation / use case for changing the behavior?
I have some styles that rely on the touched state. In some cases and need to set manually the touched state for all the controls, for example, after the user clicks on the save button.

  • Angular version:
    2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions