Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions client/src/components/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export const Calendar = ({

// FullCalendar の state
const [events, setEvents] = useState<CalendarEvent[]>([]);
const [tooltipKey, setTooltipKey] = useState<number>(0);

// editingSlots/viewingSlots → matrix → events
useEffect(() => {
Expand Down Expand Up @@ -460,6 +461,13 @@ export const Calendar = ({
}
}, []);

/**
* カレンダーで表示される日付範囲が変更されると呼ばれる。 https://fullcalendar.io/docs/datesSet
*/
const handleDatesSet = useCallback(() => {
setTooltipKey((prev) => prev + 1);
}, []);

return (
<div className="my-2 flex-1" id="ih-cal-wrapper">
<FullCalendar
Expand All @@ -481,8 +489,10 @@ export const Calendar = ({
select={handleSelect}
eventDidMount={handleEventDidMount}
eventContent={handleEventContent}
datesSet={handleDatesSet}
/>
<Tooltip
key={tooltipKey}
id="member-info"
style={{
backgroundColor: "#fff",
Expand Down