Skip to content

Commit d5e8d22

Browse files
committed
Ignore focusout event for validation change tracking
1 parent e018b38 commit d5e8d22

File tree

1 file changed

+8
-3
lines changed
  • packages/ember-bootstrap-constraint-validations/src/components/bs-form

1 file changed

+8
-3
lines changed

packages/ember-bootstrap-constraint-validations/src/components/bs-form/element.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ export default class BsFormElement extends BaseBsFormElement {
3434
}
3535

3636
@action
37-
showValidationOnHandler(...args) {
37+
showValidationOnHandler(event) {
3838
// native validation state doesn't integrate with Ember's autotracking, so we need to invalidate our `errors` getter explicitly when an
3939
// event occurs that could change the validation state
40-
this._invalidateErrors++;
41-
super.showValidationOnHandler(...args);
40+
41+
if (event.type !== 'focusout') {
42+
// ignore focusout event, as this won't be able to change the validation state, but mutating _invalidateErrors can cause "same computation" assertions
43+
this._invalidateErrors++;
44+
}
45+
46+
super.showValidationOnHandler(event);
4247
}
4348
}

0 commit comments

Comments
 (0)