Skip to content

Commit 60552b6

Browse files
fix: improve alert overlay z-index and prevent text wrapping
- Increase z-index from 9999 to 99999 to ensure alert popup appears above all modules - Add explicit positioning styles (position, top, left, width, height) to overlay - Prevent alert text wrapping by adding white-space: nowrap and font-size: 20px - Fixes click-through issue where underlying modules (e.g., calendar) were interactive behind alert Based on user feedback in #31
1 parent 2882c8f commit 60552b6

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

MMM-OneCallWeather.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
text-align: center;
8181
font-weight: bold;
8282
color: #ff8c8c;
83+
font-size: 20px;
84+
white-space: nowrap;
8385
padding: 0.5em;
8486
line-height: 1.4;
8587
}
@@ -279,7 +281,7 @@
279281
width: 100vw;
280282
height: 100vh;
281283
background: rgba(0, 0, 0, 0.7);
282-
z-index: 9999;
284+
z-index: 99999;
283285
display: flex;
284286
align-items: center;
285287
justify-content: center;

MMM-OneCallWeather.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,13 @@ Module.register('MMM-OneCallWeather', {
860860
}
861861
}
862862
// Make sure it blocks all clicks to underlying modules
863+
overlay.style.position = 'fixed'
864+
overlay.style.top = '0'
865+
overlay.style.left = '0'
866+
overlay.style.width = '100vw'
867+
overlay.style.height = '100vh'
868+
overlay.style.zIndex = '99999' // on top of everything
863869
overlay.style.pointerEvents = 'auto' // ensure overlay captures all clicks
864-
overlay.style.zIndex = '9999' // on top of everything
865870
// Stop clicks inside overlay from propagating
866871
overlay.addEventListener('click', (e) => {
867872
if (e.target === overlay) {

0 commit comments

Comments
 (0)