Skip to content

Commit

Permalink
Add option to force re-measuring of scrollbars
Browse files Browse the repository at this point in the history
Fixes issue with initial measuring happening in a display:none
container which sets scrollbar width/height to 0
  • Loading branch information
nickfogler committed Dec 20, 2017
1 parent b346672 commit 7d1627f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ if (typeof Slick === "undefined") {
(options.createPreHeaderPanel && options.showPreHeaderPanel ? options.preHeaderPanelHeight + getVBoxDelta($preHeaderPanelScroller) : 0);
}

function resizeCanvas() {
function resizeCanvas(forceUpdate) {
if (!initialized) { return; }
if (options.autoHeight) {
viewportH = options.rowHeight * getDataLengthIncludingAddNew();
Expand All @@ -1934,6 +1934,10 @@ if (typeof Slick === "undefined") {
if (!options.autoHeight) {
$viewport.height(viewportH);
}

if (forceUpdate) {
scrollbarDimensions = measureScrollbar();
}

if (options.forceFitColumns) {
autosizeColumns();
Expand Down

0 comments on commit 7d1627f

Please sign in to comment.