Skip to content

Commit 59975f0

Browse files
fix(resizer): check for undefined option instead of fallback (#474)
Co-authored-by: Ghislain Beaulac <ghislain.beaulac@se.com>
1 parent 10f0b7d commit 59975f0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/modules/angular-slickgrid/services/resizer.service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class ResizerService {
9595

9696
// calculate bottom padding
9797
// if using pagination, we need to add the pagination height to this bottom padding
98-
let bottomPadding = (autoResizeOptions && autoResizeOptions.bottomPadding) ? autoResizeOptions.bottomPadding : DATAGRID_BOTTOM_PADDING;
98+
let bottomPadding = (autoResizeOptions && autoResizeOptions.bottomPadding !== undefined) ? autoResizeOptions.bottomPadding : DATAGRID_BOTTOM_PADDING;
9999
if (bottomPadding && gridOptions.enablePagination) {
100100
bottomPadding += DATAGRID_PAGINATION_HEIGHT;
101101
}
@@ -122,9 +122,9 @@ export class ResizerService {
122122
const availableHeight = gridHeight - gridOffsetTop - bottomPadding;
123123
const availableWidth = this._gridContainerElm.width() || window.innerWidth || 0;
124124
const maxHeight = autoResizeOptions && autoResizeOptions.maxHeight || undefined;
125-
const minHeight = autoResizeOptions && autoResizeOptions.minHeight || DATAGRID_MIN_HEIGHT;
125+
const minHeight = (autoResizeOptions && autoResizeOptions.minHeight !== undefined) ? autoResizeOptions.minHeight : DATAGRID_MIN_HEIGHT;
126126
const maxWidth = autoResizeOptions && autoResizeOptions.maxWidth || undefined;
127-
const minWidth = autoResizeOptions && autoResizeOptions.minWidth || DATAGRID_MIN_WIDTH;
127+
const minWidth = (autoResizeOptions && autoResizeOptions.minWidth !== undefined) ? autoResizeOptions.minWidth : DATAGRID_MIN_WIDTH;
128128

129129
let newHeight = availableHeight;
130130
let newWidth = (autoResizeOptions && autoResizeOptions.sidePadding) ? availableWidth - autoResizeOptions.sidePadding : availableWidth;

test/cypress/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"author": "Ghislain B.",
1212
"license": "MIT",
1313
"devDependencies": {
14-
"cypress": "^4.5.0",
14+
"cypress": "^4.6.0",
1515
"mocha": "^5.2.0",
1616
"mochawesome": "^3.1.2",
1717
"mochawesome-merge": "^1.0.7",

0 commit comments

Comments
 (0)