Skip to content

Commit 677114d

Browse files
committed
bug: adjusting window scroll after scrolling the calendar
1 parent e9b57bb commit 677114d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/CalendarBody.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ function Calendar<T extends GenericEvent>({
7272
const rowRef = useRef<null | HTMLDivElement>(null);
7373
useEffect(() => {
7474
if (rowRef.current) {
75+
// INFO: first scrolling both the calendar and the window, and then scrolling back the window
7576
rowRef.current?.scrollIntoView();
77+
window.scrollTo(0, 0);
7678
}
7779
}, [rowRef]);
7880

@@ -156,6 +158,7 @@ function Calendar<T extends GenericEvent>({
156158
<div>
157159
<Table
158160
rowKey={record => record.id}
161+
className="test"
159162
dataSource={getDayHoursEvents(weekDates, getDayEvents)}
160163
columns={tableColumns}
161164
pagination={false}
@@ -168,7 +171,7 @@ function Calendar<T extends GenericEvent>({
168171
backgroundColor: 'white',
169172
position: 'sticky',
170173
boxShadow: 'rgba(0, 0, 0, 0.05) -1px 4px 4px ',
171-
zIndex: 1,
174+
zIndex: 2,
172175
top: 0,
173176
},
174177
};

0 commit comments

Comments
 (0)