Skip to content

Commit

Permalink
fix(resizer): fix a regression bug caused by previous
Browse files Browse the repository at this point in the history
- resizer service init must be done only after SlickGrid is initialized, else we end up binding our resize to a grid dom element that doesn't yet exist in the DOM
- this regression bug wasn't caught earlier because there's no Cypress E2E to test that since it's too hard to test, basically it was caught manually since I found out the auto-resize stopped working (it failed silently) and I was wondering why that suddenly happened
  • Loading branch information
ghiscoding committed May 21, 2021
1 parent 8a5ba09 commit 1e47ed2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Binary file modified screenshots/formatters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -892,9 +892,6 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy, OnIn
this.sharedService.dataView = this.dataView;
this.sharedService.grid = this.grid;

// load the resizer service
this.resizer.init(this.grid);

this.extensionService.bindDifferentExtensions();
this.bindDifferentHooks(this.grid, this.gridOptions, this.dataView);

Expand All @@ -910,6 +907,10 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy, OnIn
// initialize the SlickGrid grid
this.grid.init();

// initialized the resizer service only after SlickGrid is initialized
// if we don't we end up binding our resize to a grid element that doesn't yet exist in the DOM and the resizer service will fail silently (because it has a try/catch that unbinds the resize without throwing back)
this.resizer.init(this.grid);

// when using Tree Data View
if (this.gridOptions.enableTreeData) {
this.treeDataService.init(this.grid);
Expand Down

0 comments on commit 1e47ed2

Please sign in to comment.