diff --git a/package.json b/package.json index b1cfcdb..20e1519 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.1.1", + "version": "1.1.2", "license": "MIT", "main": "dist/index.js", "description": "weekly calendar for antd", diff --git a/src/components/CalendarBody.tsx b/src/components/CalendarBody.tsx index 86d1557..8ca8053 100644 --- a/src/components/CalendarBody.tsx +++ b/src/components/CalendarBody.tsx @@ -72,7 +72,9 @@ function Calendar({ const rowRef = useRef(null); useEffect(() => { if (rowRef.current) { + // INFO: first scrolling both the calendar and the window, and then scrolling back the window rowRef.current?.scrollIntoView(); + window.scrollTo(0, 0); } }, [rowRef]); @@ -168,7 +170,7 @@ function Calendar({ backgroundColor: 'white', position: 'sticky', boxShadow: 'rgba(0, 0, 0, 0.05) -1px 4px 4px ', - zIndex: 1, + zIndex: 2, top: 0, }, };