From ee230978169bb4d6b561ad254b1b0bf15f64c6ce Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Mon, 6 Oct 2025 23:40:20 +0800 Subject: [PATCH] Set modal's mask-closable attribute to yes by default (#9313) * Set modal's mask-closable attribute to yes by default * Make backdrop closable only when field value is yes or empty --- core/modules/utils/dom/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/utils/dom/modal.js b/core/modules/utils/dom/modal.js index 4e407499eb..a7b538ec3a 100644 --- a/core/modules/utils/dom/modal.js +++ b/core/modules/utils/dom/modal.js @@ -210,7 +210,7 @@ Modal.prototype.display = function(title,options) { bodyWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false); footerWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false); // Whether to close the modal dialog when the mask (area outside the modal) is clicked - if(tiddler.fields && (tiddler.fields["mask-closable"] === "yes" || tiddler.fields["mask-closable"] === "true")) { + if(tiddler.fields && (tiddler.fields["mask-closable"] === "yes" || tiddler.fields["mask-closable"] === "true" || tiddler.fields["mask-closable"] === "" || "mask-closable" in tiddler.fields === false)) { modalBackdrop.addEventListener("click",closeHandler,false); } // Set the initial styles for the message