this.#dialog.classList.add("dialog");
this.#dialog.setAttribute("aria-labelledby", DomUtil.identify(this.#title));
- this.#dialog.addEventListener("cancel", (event) => {
- if (!this.#shouldClose()) {
- event.preventDefault();
- return;
- }
+ this.#dialog.addEventListener("cancel", () => {
+ const event = new CustomEvent("cancel");
+ this.dispatchEvent(event);
this.#detachDialog();
});
this.#dialog.append(doc);
this.#dialog.classList.add("dialog");
this.#dialog.setAttribute("aria-labelledby", Util_1.default.identify(this.#title));
- this.#dialog.addEventListener("cancel", (event) => {
- if (!this.#shouldClose()) {
- event.preventDefault();
- return;
- }
+ this.#dialog.addEventListener("cancel", () => {
+ const event = new CustomEvent("cancel");
+ this.dispatchEvent(event);
this.#detachDialog();
});
// Close the dialog by clicking on the backdrop.