Skip to content

Commit 779977f

Browse files
authored
fix: cap the estimated height to the screen height (#5318)
1 parent 8bd79ed commit 779977f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/visualization/types/SimpleTable/PagedTable.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ const PagedTable: FC<Props> = ({result, properties}) => {
278278

279279
timeout = setTimeout(() => {
280280
animationFrameID = requestAnimationFrame(() => {
281-
setHeight(entries[0].contentRect.height)
281+
setHeight(
282+
Math.min(entries[0].contentRect.height, window.screen.height)
283+
)
282284
})
283285
}, 200)
284286
})
@@ -290,7 +292,7 @@ const PagedTable: FC<Props> = ({result, properties}) => {
290292
const rect = curr?.getBoundingClientRect()
291293

292294
if (rect && rect.height !== height) {
293-
setHeight(rect.height)
295+
setHeight(Math.min(rect.height, window.screen.height))
294296
}
295297

296298
return () => {

0 commit comments

Comments
 (0)