}
#detachDialog(): void {
+ if (this.parentNode === null) {
+ return;
+ }
+
const event = new CustomEvent("afterClose");
this.dispatchEvent(event);
this.#dialog.addEventListener("close", () => {
if (this.#dialog.returnValue === "") {
// Dialog was programmatically closed.
- return;
+ } else {
+ this.#dispatchPrimaryEvent();
}
- this.#dispatchPrimaryEvent();
-
this.#detachDialog();
});
this.#detachDialog();
}
#detachDialog() {
+ if (this.parentNode === null) {
+ return;
+ }
const event = new CustomEvent("afterClose");
this.dispatchEvent(event);
(0, PageOverlay_1.releasePageOverlayContainer)(this.#dialog);
this.#dialog.addEventListener("close", () => {
if (this.#dialog.returnValue === "") {
// Dialog was programmatically closed.
- return;
}
- this.#dispatchPrimaryEvent();
+ else {
+ this.#dispatchPrimaryEvent();
+ }
this.#detachDialog();
});
formControl.addEventListener("cancel", () => {