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 minuteColRef = ref<HTMLElement | null>(null);
|
||||||
const top = ref(0);
|
const top = ref(0);
|
||||||
const left = ref(0);
|
const left = ref(0);
|
||||||
|
/** بالای مودال Ant (حدود ۱۰۰۰) تا تقویم پشت پنجره نماند */
|
||||||
|
const popupZ = ref(120);
|
||||||
const todayJ = dateToJalali(new Date());
|
const todayJ = dateToJalali(new Date());
|
||||||
const cursor = ref<{ jy: number; jm: number }>({ jy: todayJ.jy, jm: todayJ.jm });
|
const cursor = ref<{ jy: number; jm: number }>({ jy: todayJ.jy, jm: todayJ.jm });
|
||||||
const draftHour = ref(9);
|
const draftHour = ref(9);
|
||||||
@@ -349,6 +351,15 @@ function place() {
|
|||||||
top.value = nextTop;
|
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() {
|
function onWindowChange() {
|
||||||
syncViewport();
|
syncViewport();
|
||||||
if (open.value) place();
|
if (open.value) place();
|
||||||
@@ -360,6 +371,7 @@ async function show() {
|
|||||||
calView.value = 'days';
|
calView.value = 'days';
|
||||||
clockFace.value = 'hour';
|
clockFace.value = 'hour';
|
||||||
syncViewport();
|
syncViewport();
|
||||||
|
liftAboveOverlays();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
await nextTick();
|
await nextTick();
|
||||||
place();
|
place();
|
||||||
@@ -554,7 +566,7 @@ onBeforeUnmount(() => {
|
|||||||
'is-desktop': !isMobile,
|
'is-desktop': !isMobile,
|
||||||
}"
|
}"
|
||||||
role="dialog"
|
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">
|
<header v-if="mode !== 'time'" class="nav">
|
||||||
<a-button type="text" class="nav-btn" :aria-label="navLabels.forward" @click="navStep(1)">
|
<a-button type="text" class="nav-btn" :aria-label="navLabels.forward" @click="navStep(1)">
|
||||||
|
|||||||
Reference in New Issue
Block a user