From 05291e88fbeb04913c3310042124d69c91462efc Mon Sep 17 00:00:00 2001 From: MarekWo Date: Fri, 24 Apr 2026 21:55:14 +0200 Subject: [PATCH] fix(regions): dim Manage Channels modal when region picker opens on top Bump the picker modal's z-index (1075) and its backdrop (1065) above the underlying Manage Channels modal (1055) so the two layers visually separate instead of blending together. Co-Authored-By: Claude Opus 4.7 --- app/static/js/app.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/static/js/app.js b/app/static/js/app.js index a082d8c..3cd9579 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -3005,6 +3005,22 @@ async function openRegionPicker(channelIdx) { renderRegionPickerList(); const modalEl = document.getElementById('regionPickerModal'); + // Stacked-modal fix: when opened on top of Manage Channels, bump z-index so + // the new backdrop dims the channels modal underneath instead of sliding behind it. + const onShown = () => { + const backdrops = document.querySelectorAll('.modal-backdrop'); + if (backdrops.length > 1) { + modalEl.style.zIndex = '1075'; + backdrops[backdrops.length - 1].style.zIndex = '1065'; + } + }; + const onHidden = () => { + modalEl.style.zIndex = ''; + modalEl.removeEventListener('shown.bs.modal', onShown); + modalEl.removeEventListener('hidden.bs.modal', onHidden); + }; + modalEl.addEventListener('shown.bs.modal', onShown); + modalEl.addEventListener('hidden.bs.modal', onHidden); bootstrap.Modal.getOrCreateInstance(modalEl).show(); }