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): add autoResize.autoHeight to resize by dataset length #1820

Merged
merged 8 commits into from
Jan 25, 2025

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Jan 25, 2025

The auto-resize is great but it had a flaw that always bothered me but wasn't sure on how to fix it. The problem is that it always resized the grid with all available viewport space regardless of the dataset and in some cases when the dataset was small, it showed a full size grid in the UI with in some cases a rather large empty whitespace area at the bottom of the grid. This PR fixes it once and for all. We always had the grid option autoHeight which was good when the user knows its dataset is small, but most of the time we don't know dataset length at all, it could be small today but large next month, so we can't use autoHeight grid option for that reason.... this PR adds the grid option autoResize.autoHeight (yes it's the same flag name but it's not under the same property), it's enabled by default but user could disable it if he wants and it doesn't do anything unless enableAutoResize is enabled which is why it's under that group. Another thing that is useful to know is that it's re-validated every time the dataset count changes (by either new data assignment OR data filtering). Lastly we should also note that the we have a autoResize.minHeight to avoid resizing too small (it was always in place but I increased it to 250px)

image

after fix

brave_wvRzO9334t

Verified

This commit was signed with the committer’s verified signature.
dougbu Doug Bunting
Copy link

stackblitz bot commented Jan 25, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@ghiscoding
Copy link
Owner Author

ghiscoding commented Jan 25, 2025

cc @zewa666

.... side note, this is the last PR that I wanted to do before pushing a new release. I also fixed yesterday the RowSpan and Excel Export with cell merge. I pushed a bunch of other fixes too since I started using Slickgrid-Vue on a work project, yes finally! 🚀

Copy link

codecov bot commented Jan 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.5%. Comparing base (0c5210f) to head (10015e3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1820     +/-   ##
========================================
+ Coverage    99.5%   99.5%   +0.1%     
========================================
  Files         187     187             
  Lines       34467   34496     +29     
  Branches    10202   10210      +8     
========================================
+ Hits        34284   34313     +29     
  Misses        183     183             

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Verified

This commit was signed with the committer’s verified signature.
dougbu Doug Bunting
…ta changes

Verified

This commit was signed with the committer’s verified signature.
dougbu Doug Bunting
@zewa666
Copy link
Contributor

zewa666 commented Jan 25, 2025

thats great. I have a reported bug with autoresize and using frozen columns which I need to verify but I will check out this PR together with it.

@ghiscoding ghiscoding merged commit f278140 into master Jan 25, 2025
7 checks passed
@ghiscoding ghiscoding deleted the bugfix/resize-dataset-length branch January 25, 2025 07:02
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