Skip to content

Commit 6985bf8

Browse files
committed
Prevent tracking form for input without parent form.
Also, use = undefined instead of delete. (Faster)
1 parent 0d229ba commit 6985bf8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ export class ValidationService {
640640
}
641641
}
642642

643-
delete this.summary[uid];
643+
this.summary[uid] = undefined;
644644
}
645645
this.renderSummary();
646646
});
@@ -659,7 +659,9 @@ export class ValidationService {
659659
let validate = this.createValidator(input, directives);
660660

661661
this.validators[uid] = validate;
662-
this.trackFormInput(input.form, uid);
662+
if (input.form) {
663+
this.trackFormInput(input.form, uid);
664+
}
663665

664666
if (this.elementEvents[uid]) {
665667
return;
@@ -782,7 +784,7 @@ export class ValidationService {
782784
input.classList.add('input-validation-valid');
783785

784786
let uid = this.getElementUID(input);
785-
delete this.summary[uid];
787+
this.summary[uid] = undefined;
786788
this.renderSummary();
787789
}
788790

0 commit comments

Comments
 (0)