Skip to content

Commit 525cf84

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/CalendarBody.tsx

Lines changed: 3 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

@@ -168,7 +170,7 @@ function Calendar<T extends GenericEvent>({
168170
backgroundColor: 'white',
169171
position: 'sticky',
170172
boxShadow: 'rgba(0, 0, 0, 0.05) -1px 4px 4px ',
171-
zIndex: 1,
173+
zIndex: 2,
172174
top: 0,
173175
},
174176
};

0 commit comments

Comments
 (0)