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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user