Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit db3de37

Browse files
committed
fixed removeFromValidationSummary to also remove from 'local' array
before this a validationSummary entry would reappear on "go back" in wizard.
1 parent 046ffe0 commit db3de37

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/validation-common.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,15 @@ angular
167167
* @param object validationSummary
168168
* @param string elmName: element name
169169
*/
170-
function removeFromValidationSummary(validationSummary, elmName) {
171-
var index = arrayFindObjectIndex(validationSummary, 'field', elmName); // find index of object in our array
172-
// if message is empty, remove it from the validation summary
170+
function removeFromValidationSummary(validationSummaryObj, elmName) {
171+
var index = arrayFindObjectIndex(validationSummaryObj, 'field', elmName); // find index of object in our array
172+
// if message is empty, remove it from the validation summary object
173173
if(index >= 0) {
174+
validationSummaryObj.splice(index, 1);
175+
}
176+
// also remove from 'local' validationSummary
177+
index = arrayFindObjectIndex(validationSummary, 'field', elmName); // find index of object in our array
178+
if(index >= 0) {
174179
validationSummary.splice(index, 1);
175180
}
176181
}

0 commit comments

Comments
 (0)