diff --git a/slick.core.js b/slick.core.js index 62b748d6..ba3e78f9 100644 --- a/slick.core.js +++ b/slick.core.js @@ -845,7 +845,7 @@ } function width(el, value) { - if (!el) return; + if (!el || !el.getBoundingClientRect) return; if (value === undefined) { return el.getBoundingClientRect().width } diff --git a/slick.grid.js b/slick.grid.js index 0c7d842b..db8d2a8a 100644 --- a/slick.grid.js +++ b/slick.grid.js @@ -904,6 +904,11 @@ if (typeof Slick === "undefined") { utils.width(_headerR, headersWidthR); if (hasFrozenColumns()) { + const cWidth = utils.width(_container) || 0; + if (cWidth > 0 && canvasWidthL > cWidth) { + throw new Error('[SlickGrid] Frozen columns cannot be wider than the actual grid container width. ' + + 'Make sure to have less columns freezed or make your grid container wider'); + } utils.width(_canvasTopR, canvasWidthR); utils.width(_paneHeaderL, canvasWidthL);