Prevent manga page description from jumping on initial render

Due to using the resize observer to get the actual chapter list header size, the size is 0 initially, which caused the virtuoso list height to be too big, causing an overflow and the scrollbar to appear.
This scrollbar immediately disappeared again but still caused the description to slightly "jump"
This commit is contained in:
schroda
2024-09-01 01:39:13 +02:00
parent 395092099a
commit fe8043c232

View File

@@ -83,7 +83,7 @@ export const ChapterList = ({
const isMobileWidth = MediaQuery.useIsBelowWidth('md');
const [chapterListHeaderHeight, setChapterListHeaderHeight] = useState(0);
const [chapterListHeaderHeight, setChapterListHeaderHeight] = useState(50);
const [chapterListHeaderRef, setChapterListHeaderRef] = useState<HTMLDivElement | null>(null);
useResizeObserver(
chapterListHeaderRef,