fix(select-rich): instantiation after first update

This commit is contained in:
Mathieu Puech 2020-06-22 10:01:01 -04:00
parent c2b7766492
commit 184898c111
2 changed files with 3 additions and 9 deletions

View file

@ -32,7 +32,6 @@ export const FormRegistrarPortalMixin = dedupeMixin(
if (super.connectedCallback) {
super.connectedCallback();
}
this.__checkRegistrationTarget();
formRegistrarManager.add(this);
if (this.__hasBeenRendered) {
@ -66,6 +65,7 @@ export const FormRegistrarPortalMixin = dedupeMixin(
}
firstUpdated(changedProperties) {
this.__checkRegistrationTarget();
super.firstUpdated(changedProperties);
this.__resolveRegistrationReady();
this.__readyForRegistration = true;

View file

@ -203,17 +203,9 @@ export class LionSelectRich extends ScopedElementsMixin(
this.__hasInitialSelectedFormElement = false;
this.hasNoDefaultSelected = false;
this._repropagationRole = 'choice-group'; // configures FormControlMixin
this.__setupEventListeners();
this.__initInteractionStates();
}
connectedCallback() {
this._listboxNode.registrationTarget = this;
if (super.connectedCallback) {
super.connectedCallback();
}
}
disconnectedCallback() {
if (super.disconnectedCallback) {
super.disconnectedCallback();
@ -233,6 +225,8 @@ export class LionSelectRich extends ScopedElementsMixin(
this.__setupInvokerNode();
this.__setupListboxNode();
this.__setupEventListeners();
this._listboxNode.registrationTarget = this;
formRegistrarManager.addEventListener('all-forms-open-for-registration', () => {
// Now that we have rendered + registered our listbox, try setting the user defined modelValue again