fix(modal, popover): remove trigger click listeners when overlay is unmounted (#26167)

This commit is contained in:
Amanda Johnston
2022-10-26 13:59:43 -05:00
committed by GitHub
parent a7e15babf3
commit 1320948b24
4 changed files with 61 additions and 8 deletions

View File

@ -332,7 +332,17 @@ export class Modal implements ComponentInterface, OverlayInterface {
}
connectedCallback() {
prepareOverlay(this.el);
const { configureTriggerInteraction, el } = this;
prepareOverlay(el);
configureTriggerInteraction();
}
disconnectedCallback() {
const { destroyTriggerInteraction } = this;
if (destroyTriggerInteraction) {
destroyTriggerInteraction();
}
}
componentWillLoad() {
@ -371,7 +381,6 @@ export class Modal implements ComponentInterface, OverlayInterface {
raf(() => this.present());
}
this.breakpointsChanged(this.breakpoints);
this.configureTriggerInteraction();
}
private configureTriggerInteraction = () => {