Skip to content

Commit

Permalink
fix: floating info about calendar events
Browse files Browse the repository at this point in the history
  • Loading branch information
Makcal authored and ArtemSBulgakov committed Aug 13, 2024
1 parent 44a92e6 commit d86e216
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions components/common/calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ function Calendar({
<CalendarEventPopover
event={popoverInfo.event}
isOpen={popoverInfo.opened}
setIsOpen={() =>
setPopoverInfo((prev) => ({ ...prev, opened: !prev.opened }))
}
setIsOpen={() => setPopoverInfo((prev) => ({ ...prev }))}
eventElement={popoverInfo.eventElement}
/>
)}
Expand Down
5 changes: 4 additions & 1 deletion components/common/calendar/CalendarEventPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "@floating-ui/react";
import { EventApi } from "@fullcalendar/core";
import moment from "moment";
import React from "react";
import React, { useEffect } from "react";

export type ScheduleDialogProps = {
event: EventApi;
Expand Down Expand Up @@ -42,6 +42,9 @@ export default function CalendarEventPopover({
reference: eventElement,
},
});
useEffect(() => {
refs.setPositionReference(eventElement);
}, [eventElement, refs]);

// Transition effect
const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {
Expand Down

0 comments on commit d86e216

Please sign in to comment.