fix: make strict bottom position of DateRangePicker optional (#19768)

* make strictbottom optional

* chore
This commit is contained in:
Vijay authored and GitHub committed 2025-03-05 17:26:10 +00:00
1 parent b8f0741923
commit 0e4309777b
2 files changed
+5 -2

No files matched your search

@@ -296,6 +296,7 @@ export const CreateOrEditOutOfOfficeEntryModal = ({
onDatesChange={(values) => {
onChange(values);
}}
strictlyBottom={true}
/>
)}
/>
@@ -17,6 +17,7 @@ type DatePickerWithRangeProps = {
maxDate?: Date;
withoutPopover?: boolean;
"data-testid"?: string;
strictlyBottom?: boolean;
};
export function DatePickerWithRange({
@@ -28,6 +29,7 @@ export function DatePickerWithRange({
disabled,
withoutPopover,
"data-testid": testId,
strictlyBottom,
}: React.HTMLAttributes<HTMLDivElement> & DatePickerWithRangeProps) {
function handleDayClick(date: Date) {
if (dates?.endDate) {
@@ -86,8 +88,8 @@ export function DatePickerWithRange({
className="bg-default text-emphasis z-50 w-auto rounded-md border p-0 outline-none"
align="start"
sideOffset={4}
side="bottom"
avoidCollisions={false}>
side={strictlyBottom ? "bottom" : undefined}
avoidCollisions={!strictlyBottom}>
{calendar}
</Popover.Content>
</Popover.Root>