fix(ngModel): fix issues when parserName is same as validator key#10850
fix(ngModel): fix issues when parserName is same as validator key#10850Narretz wants to merge 2 commits into
Conversation
For $validate(), it is necessary to store the parseError state in the controller. Otherwise, if the parser name equals a validator key, $validate() will assume a parse error occured if the validator is invalid. Also, setting the validity for the parser now happens after setting validity for the validator key. Otherwise, the parse key is set, and then immediately afterwards the validator key is unset (because parse errors remove all other validations). Fixes angular#10698 Closes angular#10850
bd1795e to
5d62a95
Compare
There was a problem hiding this comment.
This variable doesn't seem to be used now. What does this mean for the default of 'parse'?
There was a problem hiding this comment.
I see that the errorKey variable sets the default below on line 563
|
I updated the test. I removed the variables that handle the validity of parser / validators. Instead, they now directly react to the input. If you're okay with the test, can we merge this, and push the parseName refactor back? The bug is pretty gnarly and we can fix the parser name later. |
For $validate(), it is necessary to store the parseError state in the controller. Otherwise, if the parser name equals a validator key, $validate() will assume a parse error occured if the validator is invalid. Also, setting the validity for the parser now happens after setting validity for the validator key. Otherwise, the parse key is set, and then immediately afterwards the validator key is unset (because parse errors remove all other validations). Fixes angular#10698 Closes angular#10850
For $validate(), it is necessary to store the parseError state in the controller. Otherwise, if the parser name equals a validator key, $validate() will assume a parse error occured if the validator is invalid. Also, setting the validity for the parser now happens after setting validity for the validator key. Otherwise, the parse key is set, and then immediately afterwards the validator key is unset (because parse errors remove all other validations). Fixes #10698 Closes #10850 Closes #11046
|
Oh! Sorry @Narretz - when I squashed I attributed it to me instead of you. I am sorry about that - I will not do it again. Great work. |
For $validate(), it is necessary to store the parseError state in the controller. Otherwise, if the parser name equals a validator key, $validate() will assume a parse error occured if the validator is invalid. Also, setting the validity for the parser now happens after setting validity for the validator key. Otherwise, the parse key is set, and then immediately afterwards the validator key is unset (because parse errors remove all other validations). Fixes angular#10698 Closes angular#10850 Closes angular#11046
For $validate(), it is necessary to store the parseError state
in the controller. Otherwise, if the parser name equals a validator
key, $validate() will assume a parse error occured if the validator
is invalid.
Also, setting the validity for the parser now happens after setting
validity for the validator key. Otherwise, the parse key is set,
and then immediately afterwards the validator key is unset
(because parse errors remove all other validations).
Fixes #10698
Closes #10828