Skip to content

Commit 92139ee

Browse files
committed
timetable - fixed for rows not rendering in the first render
1 parent c013843 commit 92139ee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/src/components/timetable/TimeTable.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
import { useGroupRows } from "./useGoupRows"
4141
import { twMerge } from "tailwind-merge"
4242
import { getStartAndEndSlot } from "./timeTableUtils"
43+
import { flushSync } from "react-dom"
4344

4445
export interface TimeSlotBooking {
4546
title: string
@@ -415,6 +416,11 @@ const LPTimeTableImpl = <G extends TimeTableGroup, I extends TimeSlotBooking>({
415416
}
416417
}, [adjustNowBar])
417418

419+
// since the groups are redone, we need to adjust the now bar to draw it again
420+
useEffect(() => {
421+
window.setTimeout(() => flushSync(adjustNowBar), 0)
422+
}, [entries])
423+
418424
const observedSizeChangedCB = useCallback(() => {
419425
if (!slotsArray) {
420426
return

0 commit comments

Comments
 (0)