Skip to content

Commit 991af25

Browse files
committed
fix(form-registrar-mixin): ensure becomesReady called only once
1 parent 75b3e2c commit 991af25

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/field/src/FormRegistrarMixin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const FormRegistrarMixin = dedupeMixin(
2525
super();
2626
this.formElements = [];
2727
this.__readyForRegistration = false;
28+
this.__hasBeenRenedered = false;
2829
this.registrationReady = new Promise(resolve => {
2930
this.__resolveRegistrationReady = resolve;
3031
});
@@ -38,7 +39,9 @@ export const FormRegistrarMixin = dedupeMixin(
3839
super.connectedCallback();
3940
}
4041
formRegistrarManager.add(this);
41-
formRegistrarManager.becomesReady(this);
42+
if (this.__hasBeenRenedered) {
43+
formRegistrarManager.becomesReady(this);
44+
}
4245
}
4346

4447
disconnectedCallback() {
@@ -57,6 +60,7 @@ export const FormRegistrarMixin = dedupeMixin(
5760
this.__resolveRegistrationReady();
5861
this.__readyForRegistration = true;
5962
formRegistrarManager.becomesReady(this);
63+
this.__hasBeenRenedered = true;
6064
}
6165

6266
addFormElement(child) {

0 commit comments

Comments
 (0)