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.

Odd behvaiour with $setViewValue + $render when debounce/async validation is used #9295

@jsdw

Description

@jsdw

In brief, setting the value of an input field X using $setViewValue("somevalue") and then running $render() when X uses debounce or an async validator, only updates the actual visible value of X if it is presently in a valid state. If it begins (or turns into) an invalid state, the actual visible value is blanked out on the next call to $setViewValue+$render, rather than set to what was passed to $setViewValue..

A plunkr demonstrating this is here (the first input will set the second one on blur, and in the top case the second one has a 1 sec async validation attached so you'll see a model update 1 second after the blur, but not a view update. If you remove the async validator it works as expected):

http://plnkr.co/edit/h1hvf79W8ovqAlNLpBvS

And my stackoverflow question here (incase it has any more useful details):

http://stackoverflow.com/questions/26035871/angularjs-how-to-set-one-input-value-from-another-and-have-it-go-through-valida

I feel as if this is a bug rather than something I am doing wrong (though am happy to be corrected!).

I am using angular 1.3.0rc2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions