Skip to content

Commit 04fc393

Browse files
committed
fix(Datepicker): incr z-index
fix display of datepicker popup by setting highest z-index; namely fixing conflict with headless ui tabs and dialog components
1 parent b19f832 commit 04fc393

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/Datepicker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ const Datepicker: React.FC<DatepickerType> = ({
333333
<Input setContextRef={setInputRef} />
334334

335335
<div
336-
className="transition-all ease-out duration-300 absolute z-10 mt-[1px] text-sm lg:text-xs 2xl:text-sm translate-y-4 opacity-0 hidden"
336+
// increase z-index so that datepicker popover is always on top
337+
className="transition-all ease-out duration-300 absolute z-50 mt-[1px] text-sm lg:text-xs 2xl:text-sm translate-y-4 opacity-0 hidden"
337338
ref={calendarContainerRef}
338339
>
339340
<Arrow ref={arrowRef} />

src/components/utils.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ export const Arrow = React.forwardRef<HTMLDivElement, {}>((props, ref) => {
123123
return (
124124
<div
125125
ref={ref}
126-
className="absolute z-20 h-4 w-4 rotate-45 mt-0.5 ml-[1.2rem] border-l border-t border-gray-300 bg-white dark:bg-slate-800 dark:border-slate-600"
126+
// increase z-index so that datepicker popover is always on top
127+
className="absolute z-40 h-4 w-4 rotate-45 mt-0.5 ml-[1.2rem] border-l border-t border-gray-300 bg-white dark:bg-slate-800 dark:border-slate-600"
127128
/>
128129
);
129130
});

0 commit comments

Comments
 (0)