fix(web): keep the Jalali picker above Ant modals
The date and time panel was opening behind the new-task dialog because its layer sat under the modal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -52,6 +52,8 @@ const hourColRef = ref<HTMLElement | null>(null);
|
||||
const minuteColRef = ref<HTMLElement | null>(null);
|
||||
const top = ref(0);
|
||||
const left = ref(0);
|
||||
/** بالای مودال Ant (حدود ۱۰۰۰) تا تقویم پشت پنجره نماند */
|
||||
const popupZ = ref(120);
|
||||
const todayJ = dateToJalali(new Date());
|
||||
const cursor = ref<{ jy: number; jm: number }>({ jy: todayJ.jy, jm: todayJ.jm });
|
||||
const draftHour = ref(9);
|
||||
@@ -349,6 +351,15 @@ function place() {
|
||||
top.value = nextTop;
|
||||
}
|
||||
|
||||
function liftAboveOverlays() {
|
||||
let z = 120;
|
||||
for (const el of document.querySelectorAll('.ant-modal-wrap, .ant-drawer')) {
|
||||
const zi = Number.parseInt(window.getComputedStyle(el).zIndex, 10);
|
||||
if (Number.isFinite(zi)) z = Math.max(z, zi + 20);
|
||||
}
|
||||
popupZ.value = z;
|
||||
}
|
||||
|
||||
function onWindowChange() {
|
||||
syncViewport();
|
||||
if (open.value) place();
|
||||
@@ -360,6 +371,7 @@ async function show() {
|
||||
calView.value = 'days';
|
||||
clockFace.value = 'hour';
|
||||
syncViewport();
|
||||
liftAboveOverlays();
|
||||
open.value = true;
|
||||
await nextTick();
|
||||
place();
|
||||
@@ -554,7 +566,7 @@ onBeforeUnmount(() => {
|
||||
'is-desktop': !isMobile,
|
||||
}"
|
||||
role="dialog"
|
||||
:style="{ top: `${top}px`, left: `${left}px` }"
|
||||
:style="{ top: `${top}px`, left: `${left}px`, zIndex: popupZ }"
|
||||
>
|
||||
<header v-if="mode !== 'time'" class="nav">
|
||||
<a-button type="text" class="nav-btn" :aria-label="navLabels.forward" @click="navStep(1)">
|
||||
|
||||
Reference in New Issue
Block a user