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 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-04-24 21:55:14 +02:00
parent d77d86087d
commit 05291e88fb
+16
View File
@@ -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();
}