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 (#664)
  • Loading branch information
xinchao-zhang authored Aug 3, 2022
1 parent 571dc12 commit d3de81c
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 @@ -832,7 +832,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 @@ -6183,4 +6194,4 @@ if (typeof Slick === "undefined") {
Grid: SlickGrid
}
});
}(jQuery));
}(jQuery));

0 comments on commit d3de81c

Please sign in to comment.