Skip to content

Commit

Permalink
fix: cap the estimated screen height (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
TCL735 authored Aug 9, 2022
1 parent 2c3bfa4 commit e20bca5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion giraffe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@influxdata/giraffe",
"version": "2.33.4",
"version": "2.33.5",
"main": "dist/index.js",
"module": "dist/index.js",
"license": "MIT",
Expand Down
6 changes: 4 additions & 2 deletions giraffe/src/components/SimpleTable/PagedTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ const PagedTable: FC<Props> = ({result, properties}) => {

timeout = setTimeout(() => {
animationFrameID = requestAnimationFrame(() => {
setHeight(entries[0].contentRect.height)
setHeight(
Math.min(entries[0].contentRect.height, window.screen.height)
)
})
}, 200)
})
Expand All @@ -289,7 +291,7 @@ const PagedTable: FC<Props> = ({result, properties}) => {
const rect = curr?.getBoundingClientRect()

if (rect && rect.height !== height) {
setHeight(rect.height)
setHeight(Math.min(rect.height, window.screen.height))
}

return () => {
Expand Down
2 changes: 1 addition & 1 deletion stories/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@influxdata/giraffe-stories",
"version": "2.33.4",
"version": "2.33.5",
"license": "MIT",
"repository": {
"type": "git",
Expand Down

0 comments on commit e20bca5

Please sign in to comment.