Skip to content

Commit

Permalink
fix: calc fullscreen height of visualization based on window height (#…
Browse files Browse the repository at this point in the history
…1621)

Fixes issue with bottom of visualization being cut off.
  • Loading branch information
jenniferarnesen authored Mar 9, 2021
1 parent d7d730f commit 13c79b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 0 additions & 6 deletions src/components/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ div:-webkit-full-screen {
margin: 0px !important;
}

div:fullscreen .dashboard-item-content,
div:-webkit-full-screen .dashboard-item-content {
height: 95vh !important;
width: 100vw !important;
}

@media print {
body {
width: 100% !important;
Expand Down
10 changes: 7 additions & 3 deletions src/components/Item/VisualizationItem/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ export class Item extends Component {
return this.props.activeType || this.props.item.type
}

getAvailableHeight = width => {
getAvailableHeight = ({ width, height }) => {
if (this.state.isFullscreen) {
return '95vh'
return (
height -
this.headerRef.current.clientHeight -
this.itemHeaderTotalMargin
)
}

const calculatedHeight =
Expand Down Expand Up @@ -261,7 +265,7 @@ export class Item extends Component {
activeType={activeType}
itemFilters={itemFilters}
availableHeight={this.getAvailableHeight(
dimensions.width
dimensions
)}
availableWidth={this.getAvailableWidth()}
/>
Expand Down

0 comments on commit 13c79b9

Please sign in to comment.