From 59975f042002eab4b49cde6b867dff3cdd881cc9 Mon Sep 17 00:00:00 2001 From: Ghislain B Date: Tue, 26 May 2020 10:00:26 -0400 Subject: [PATCH] fix(resizer): check for undefined option instead of fallback (#474) Co-authored-by: Ghislain Beaulac --- .../modules/angular-slickgrid/services/resizer.service.ts | 6 +++--- test/cypress/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/modules/angular-slickgrid/services/resizer.service.ts b/src/app/modules/angular-slickgrid/services/resizer.service.ts index 1f9fade62..0998dfc55 100644 --- a/src/app/modules/angular-slickgrid/services/resizer.service.ts +++ b/src/app/modules/angular-slickgrid/services/resizer.service.ts @@ -95,7 +95,7 @@ export class ResizerService { // calculate bottom padding // if using pagination, we need to add the pagination height to this bottom padding - let bottomPadding = (autoResizeOptions && autoResizeOptions.bottomPadding) ? autoResizeOptions.bottomPadding : DATAGRID_BOTTOM_PADDING; + let bottomPadding = (autoResizeOptions && autoResizeOptions.bottomPadding !== undefined) ? autoResizeOptions.bottomPadding : DATAGRID_BOTTOM_PADDING; if (bottomPadding && gridOptions.enablePagination) { bottomPadding += DATAGRID_PAGINATION_HEIGHT; } @@ -122,9 +122,9 @@ export class ResizerService { const availableHeight = gridHeight - gridOffsetTop - bottomPadding; const availableWidth = this._gridContainerElm.width() || window.innerWidth || 0; const maxHeight = autoResizeOptions && autoResizeOptions.maxHeight || undefined; - const minHeight = autoResizeOptions && autoResizeOptions.minHeight || DATAGRID_MIN_HEIGHT; + const minHeight = (autoResizeOptions && autoResizeOptions.minHeight !== undefined) ? autoResizeOptions.minHeight : DATAGRID_MIN_HEIGHT; const maxWidth = autoResizeOptions && autoResizeOptions.maxWidth || undefined; - const minWidth = autoResizeOptions && autoResizeOptions.minWidth || DATAGRID_MIN_WIDTH; + const minWidth = (autoResizeOptions && autoResizeOptions.minWidth !== undefined) ? autoResizeOptions.minWidth : DATAGRID_MIN_WIDTH; let newHeight = availableHeight; let newWidth = (autoResizeOptions && autoResizeOptions.sidePadding) ? availableWidth - autoResizeOptions.sidePadding : availableWidth; diff --git a/test/cypress/package.json b/test/cypress/package.json index 02c9537ca..580686113 100644 --- a/test/cypress/package.json +++ b/test/cypress/package.json @@ -11,7 +11,7 @@ "author": "Ghislain B.", "license": "MIT", "devDependencies": { - "cypress": "^4.5.0", + "cypress": "^4.6.0", "mocha": "^5.2.0", "mochawesome": "^3.1.2", "mochawesome-merge": "^1.0.7",