Skip to content

Commit e85459e

Browse files
authored
fix(dashboard): prevent date picker layout shift (#521)
1 parent ca69cbe commit e85459e

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

apps/dashboard/components/date-range-picker.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ export function DateRangePicker({
206206
<span className="truncate">{formatDisplayRange(value)}</span>
207207
</Popover.Trigger>
208208

209-
<Popover.Content className="w-auto overflow-hidden p-0" side="bottom">
209+
<Popover.Content
210+
className="w-auto overflow-hidden p-0"
211+
disableAnchorTracking
212+
side="bottom"
213+
>
210214
<div className="flex">
211215
<div className="hidden w-36 shrink-0 border-border/60 border-r sm:block">
212216
<div className="p-1.5">

packages/ui/src/components/popover.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ function Content({
2929
className,
3030
children,
3131
align = "center",
32+
disableAnchorTracking = false,
3233
side = "bottom",
3334
sideOffset = 6,
3435
...rest
3536
}: ComponentPropsWithoutRef<typeof BasePopover.Popup> & {
3637
align?: ComponentPropsWithoutRef<typeof BasePopover.Positioner>["align"];
38+
disableAnchorTracking?: ComponentPropsWithoutRef<
39+
typeof BasePopover.Positioner
40+
>["disableAnchorTracking"];
3741
side?: ComponentPropsWithoutRef<typeof BasePopover.Positioner>["side"];
3842
sideOffset?: ComponentPropsWithoutRef<
3943
typeof BasePopover.Positioner
@@ -44,6 +48,7 @@ function Content({
4448
<BasePopover.Positioner
4549
align={align}
4650
className="z-50"
51+
disableAnchorTracking={disableAnchorTracking}
4752
side={side}
4853
sideOffset={sideOffset}
4954
>

0 commit comments

Comments
 (0)