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

BUG - Html5 Validators are executed on model value change #6796

Closed
ebonphoenix opened this issue Mar 21, 2014 · 3 comments
Closed

BUG - Html5 Validators are executed on model value change #6796

ebonphoenix opened this issue Mar 21, 2014 · 3 comments

Comments

@ebonphoenix
Copy link

Model values updated on scope is blocked by invalid input state on Html5 Validators.

Example:

  • Input box of type Number has current value= foo
  • Html5 validator correctly defines value as incorrect state
  • Code resets scope value to a valid number value
  • New number passes all standard validation
  • When it reaches addNativeHtml5Validators it checks input box value for validity not the new value on the scope
  • Input box value is set to undefined
@auser auser self-assigned this Mar 21, 2014
@auser auser added this to the Backlog milestone Mar 21, 2014
@SekibOmazic
Copy link
Contributor

Could you provide a plunker or jsFiddle example?

@park9140
Copy link

This bug seems to have been introduced in 1.2.14.

Plunker:
http://plnkr.co/edit/wU7QcaGLqtymtm9A7tqW?p=preview

@caitp
Copy link
Contributor

caitp commented Mar 23, 2014

hmm, yeah, we shouldn't be running these in formatters, at least not until the view value is set... I'll write an intermediary fix for this.

caitp added a commit to caitp/angular.js that referenced this issue Mar 23, 2014
Running html5-validation immediately after model-value is updated is incorrect, because the view
has not updated, and HTML5 constraint validation has not adjusted. This should be properly fixed
later on by performing html5 validation after the view value is updated, and a comment has been
left to address this in the future.

Closes angular#6796
caitp added a commit to caitp/angular.js that referenced this issue Mar 23, 2014
Running html5-validation immediately after model-value is updated is incorrect, because the view
has not updated, and HTML5 constraint validation has not adjusted.

Closes angular#6796
@caitp caitp closed this as completed in b472d02 Mar 24, 2014
caitp added a commit that referenced this issue Mar 24, 2014
Running html5-validation immediately after model-value is updated is incorrect, because the view
has not updated, and HTML5 constraint validation has not adjusted.

Closes #6796
Closes #6806
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants