Skip to content

Commit 613a346

Browse files
committed
fix auto-scroll not working sometimes
1 parent 4d494d4 commit 613a346

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/design-library-list/use-preview-renderer.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@ export const usePreviewRenderer = (
8585

8686
setPreviewSize( newPreviewSize )
8787

88-
if ( shadowBodySizeRef.current === null ) {
89-
shadowBodySizeRef.current = {
90-
clientHeight: shadowBody.clientHeight,
91-
scrollHeight: shadowBody.scrollHeight,
92-
maxScrollTop: shadowBody.scrollHeight - shadowBody.clientHeight,
93-
}
88+
shadowBodySizeRef.current = {
89+
clientHeight: shadowBody.clientHeight,
90+
scrollHeight: shadowBody.scrollHeight,
91+
maxScrollTop: shadowBody.scrollHeight - shadowBody.clientHeight,
9492
}
9593
}
9694

0 commit comments

Comments
 (0)