Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(resizer): only bind autoresize when enabled #489

Merged

Conversation

jr01
Copy link
Collaborator

@jr01 jr01 commented Sep 21, 2021

This fixes the bug/exception mentioned here ghiscoding/Angular-Slickgrid#836 and is "PR 1".

Writing this comment I realize that just the clearTimeout would have been enough to fix the exception, but since bindAutoResizeDataGrid has this comment Bind an auto resize trigger on the datagrid, if that is enable then it will resize itself to the available space I think the added check on this.gridOptions.enableAutoResize should be done in init and is good. Also when not using auto resize resizeGrid is called from bindResizeHook in Vanilla, Angular and Aurelia, so this change shouldn't cause noticeable side effects.

@@ -251,7 +252,7 @@ export class ResizerService {

/**
* Provide the possibility to pause the resizer for some time, until user decides to re-enabled it later if he wish to.
* @param {boolean} isResizePaused are we pausing the resizer?
* @param {boolean} isResizePaused are we pausing the resizer?@C
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that @C a typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. No idea how that got there...but I'll fix it.

@codecov
Copy link

codecov bot commented Sep 21, 2021

Codecov Report

Merging #489 (d4864d3) into master (7f3eb81) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            master      #489    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          220       220            
  Lines        13580     13581     +1     
  Branches      4473      4667   +194     
==========================================
+ Hits         13580     13581     +1     
Impacted Files Coverage Δ
packages/common/src/services/resizer.service.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f3eb81...d4864d3. Read the comment docs.

@@ -117,7 +118,7 @@ export class ResizerService {
this._fixedWidth = fixedGridSizes.width;
}

if (this.gridOptions) {
if (this.gridOptions && this.gridOptions.enableAutoResize) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but isn't this make the grid to not resize even with static sizes?
Have you tried running the code in this lib project?
We need to make sure that even if enableAutoResize is disabled, this won't break grids with static sizes like the Example 1 in this webpack demo.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked out the branch on my side and it seems to work as expected so I guess we're good

@ghiscoding ghiscoding merged commit 09d5d96 into ghiscoding:master Sep 21, 2021
@ghiscoding
Copy link
Owner

tested in Aurelia-Slickgrid and all Cypress tests are passing, so I'll merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants