Skip to content

Forms 0.2.0 ChangeDetectionStrategy.OnPush causes an input to be falsely marked as invalid #9782

Closed

Description

@radoslavpetranov

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

[x ] bug report
[ ] 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
When a new model is loaded after initialization and the form is updated using .markForCheck(), the valid form would be marked as invalid so even though the name "Test" is a valid name, you need to click any of the inputs in the form in order for it to show that the name is valid. This doesn't happen if we are using the default change strategy.

Expected/desired behavior
The form should detect that "Test" is a valid name and it should mark it valid (i.e. green border on the left) by default.

Reproduction of the problem
http://plnkr.co/edit/yn4fdyGToG9gb8Loilr0?p=preview

What is the expected behavior?
The border on the left should not be RED on load - it should be green. Click on the input (or any other input in the form) fixes the issue but a click should not be needed.

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

Please tell us about your environment:

  • Angular version: 2.0.0-rc.4

Activity

  1. radoslavpetranov commented on Jul 2, 2016

    @radoslavpetranov
    Author

    P.S.
    I did not see this issue in forms 0.1.1 I believe

  2. qdouble commented on Jul 9, 2016

    @qdouble

    I'm using the latest forms-builds and also see the issue of forms falsely being marked invalid until a field is touched when using onPush detection for form fields.

  3. kara commented on Oct 17, 2016

    @kara
    Contributor

    Moving this to #10816 so we don't have multiple related issues.

  4. angular-automatic-lock-bot commented on Sep 10, 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.

  5. locked and limited conversation to collaborators on Sep 10, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions