Skip to content

FormGroup reset() doesn't reset custom form control #15741

@sharpmachine

Description

@sharpmachine

I'm submitting a ... (check one with "x")

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Custom form control does not reset when form is reset using the FormGroup reset() method. The value will clear, but control properties dirty, pristine, untouched and touched are not updated.

Expected behavior

I would expected the control properties to reset.

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/xeIy7DEg5GwTqe7JgOv9

What is the motivation / use case for changing the behavior?

The motivation is to use custom form controls.

Please tell us about your environment:

@angular/cli: 1.0.0
node: 6.10.1
os: darwin x64
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0
  • Angular version: 2.0.X

4

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

All

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    Typescript

  • Node (for AoT issues): node --version =
    node: 6.10.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions