From 9cd06d38b52cd32ace0f793cd31d7baa5ce4d9a6 Mon Sep 17 00:00:00 2001 From: Vitali Malinouski Date: Tue, 20 Dec 2022 12:32:11 -0800 Subject: [PATCH] Fixed #2355 --- src/w2utils.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/w2utils.js b/src/w2utils.js index 1f92fd72f..c923abfce 100644 --- a/src/w2utils.js +++ b/src/w2utils.js @@ -988,8 +988,15 @@ class Utils { if (!options.msg && options.msg !== 0) options.msg = '' this.unlock(box) let el = query(box).get(0) + let pWidth = el.scrollWidth + let pHeight = el.scrollHeight + // if it is body and only has absolute elements, its height will be 0, need to lock entire window + if (el.tagName == 'BODY') { + if (pWidth < innerWidth) pWidth = innerWidth + if (pHeight < innerHeight) pHeight = innerHeight + } query(box).prepend( - `
` + + `
` + '
' ) let $lock = query(box).find('.w2ui-lock') @@ -1179,7 +1186,8 @@ class Utils { } } }) - options.setFocus(options.focus) + // timeout is needed because messages opens over 0.3 seconds + setTimeout(() => options.setFocus(options.focus), 300) }) options.off('.prom') let prom = { @@ -1296,9 +1304,9 @@ class Utils { ? `data-click='["message", "${where.param}"]` : 'data-click="message"' : ''}> - + ${options.html} - + ` if (query(where.after).length > 0) { query(where.box).find(where.after).after(content)