Skip to content

Commit 0502e59

Browse files
committed
add setDimensions back in
1 parent 203cfe8 commit 0502e59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Viewer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,14 @@ function ViewerWidget(props: ViewerProps): JSX.Element {
8383
for (const entry of entries) {
8484
// get the size of viewer container
8585
let { width } = entry.contentRect;
86+
const { height } = entry.contentRect;
8687
// hide side panel if space is small
8788
setShowSidePanel(width > MIN_WIDTH_TO_SHOW_SIDE_PANEL);
8889
if (showSidePanel) {
8990
width = width - SIDE_PANEL_WIDTH;
9091
}
92+
// pass size to viewer
93+
setDimensions({ width, height });
9194
}
9295
}
9396
);

0 commit comments

Comments
 (0)