Skip to content

updateValue in a ControlGroup does not update validator classes #8787

Closed

Description

@fank

IMPORTANT: This repository's issues are reserved for feature requests and bug reports. Do not submit support requests here, see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question.

Steps to reproduce and a minimal demo of the problem

Use https://plnkr.co or similar -- try this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5

What steps should we try in your demo to see the problem?

Current behavior
By updating a value in a Control via updateValue, which will isn't valid, will run validator. error and valid property will be set.

error: ...
valid: false

But the classes which came from the NgControlStatus directive, won't be updated.
So the valid property is false and the html class is ng-valid.

If i interact with the control in the view changedetection will trigger and update the class to ng-invalid

Expected/desired behavior
A value update in the controller/component should trigger the NgControlStatus to update the classes in the view.

Other information
Will add a plunkr if #8786 is fixed

Activity

  1. ericmartinezr commented on May 23, 2016

    @ericmartinezr
    Contributor
  2. fank commented on May 24, 2016

    @fank
    ContributorAuthor

    Hm plnkr works fine, looks like something with our code is wrong

  3. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  4. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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