Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Input validity reflected on form after $removeControl #12263

@TheSharpieOne

Description

@TheSharpieOne

After removing a field from a form using $removeControl, if you change the field's value [to be invalid] it will affect the validity of the form it was removed from.
Not too sure if this is working as expected or not, but seems to be undesired.
Affected versions [at least] 1.3.x, 1.4.x

Steps to reproduce (given the following plnkr)
http://plnkr.co/edit/NZJn0zwWdKxvrIlQxUmn?p=preview

  1. Add an invalid value into the field (it accepts numbers).
  2. Note the validity of the form and field. (Form: invalid; Field: invalid)
  3. Click the button to remove the control via $removeControl(...)
  4. Note the validity of the form and field. (Form: valid; Field: [not on formCtrl])
  5. Edit the field to be invalid.
  6. Note the validity of the form and field. (Form: invalid; Field: [not on formCtrl])

For step 6 I would expect the form to no longer be affected by the field, especially since step 4 set the form to valid when the invalid field was removed.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions