fixed-react-data-grid-custom
Version:
Excel-like grid component built with React, with editors, keyboard navigation, copy & paste, and the like
25 lines (19 loc) • 504 B
JavaScript
/**
* Return window's height and width
*
* @return {Object} height and width of the window
*/
function getWindowSize() {
let width = window.innerWidth;
let height = window.innerHeight;
if (!width || !height) {
width = document.documentElement.clientWidth;
height = document.documentElement.clientHeight;
}
if (!width || !height) {
width = document.body.clientWidth;
height = document.body.clientHeight;
}
return { width, height };
}
module.exports = getWindowSize;