Merge pull request #295 from JaySunSyn/fix/cached-form
fix(form-registrar-mixin): invoke becomesReady on connectedCallback
This commit is contained in:
commit
8b1fabbf19
1 changed files with 6 additions and 1 deletions
|
|
@ -25,6 +25,7 @@ export const FormRegistrarMixin = dedupeMixin(
|
|||
super();
|
||||
this.formElements = [];
|
||||
this.__readyForRegistration = false;
|
||||
this.__hasBeenRendered = false;
|
||||
this.registrationReady = new Promise(resolve => {
|
||||
this.__resolveRegistrationReady = resolve;
|
||||
});
|
||||
|
|
@ -38,6 +39,9 @@ export const FormRegistrarMixin = dedupeMixin(
|
|||
super.connectedCallback();
|
||||
}
|
||||
formRegistrarManager.add(this);
|
||||
if (this.__hasBeenRendered) {
|
||||
formRegistrarManager.becomesReady();
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
|
|
@ -55,7 +59,8 @@ export const FormRegistrarMixin = dedupeMixin(
|
|||
super.firstUpdated(changedProperties);
|
||||
this.__resolveRegistrationReady();
|
||||
this.__readyForRegistration = true;
|
||||
formRegistrarManager.becomesReady(this);
|
||||
formRegistrarManager.becomesReady();
|
||||
this.__hasBeenRendered = true;
|
||||
}
|
||||
|
||||
addFormElement(child) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue