Skip to content

Commit

Permalink
Client - another fix for window resize (inside Remix)
Browse files Browse the repository at this point in the history
  • Loading branch information
loredanacirstea committed Feb 24, 2020
1 parent 5dcf0fd commit aa91091
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ class AppContent extends Component {
}

getWindowDimensions() {
let dims = Dimensions.get('window');
if (dims.width === 0 || dims.height === 0) {
dims = document.getElementById('ChainLensRoot')
.getBoundingClientRect();
let wdims = Dimensions.get('window');
let rootDims = document.getElementById('ChainLensRoot').getBoundingClientRect();

const dims = {
width: wdims.width || rootDims.width,
height: wdims.height || rootDims.height,
}
return dims;
}
Expand Down

0 comments on commit aa91091

Please sign in to comment.