Skip to content

Commit

Permalink
fix: adjust the left/right canvas width properly when fullWidthRows i…
Browse files Browse the repository at this point in the history
…s used
  • Loading branch information
xinchao-zhang committed Jan 28, 2022
1 parent 1db791d commit ae7e1cb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,18 @@ if (typeof Slick === "undefined") {
}
}
var totalRowWidth = canvasWidthL + canvasWidthR;
return options.fullWidthRows ? Math.max(totalRowWidth, availableWidth) : totalRowWidth;
if (options.fullWidthRows) {
var extraWidth = Math.max(totalRowWidth, availableWidth) - totalRowWidth;
if (extraWidth > 0) {
totalRowWidth += extraWidth;
if (hasFrozenColumns()) {
canvasWidthR += extraWidth;
} else {
canvasWidthL += extraWidth;
}
}
}
return totalRowWidth;
}

function updateCanvasWidth(forceColumnWidthsUpdate) {
Expand Down Expand Up @@ -6166,4 +6177,4 @@ if (typeof Slick === "undefined") {
Grid: SlickGrid
}
});
}(jQuery));
}(jQuery));

0 comments on commit ae7e1cb

Please sign in to comment.