-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Make the table trigger "fast" render instead of a full one, when the table is outside of the viewport. #10206
Conversation
…of the viewport - Add tests - Remove the unused 'lastSelectedColumn' property from the filters plugin (handsontable/dev-handsontable#561)
Launch the local version of documentation by running: npm run docs:review eb9cb44057f00173d44c21d6919a83cc1ba921ea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the changes, and here are my thoughts:
- Generally, I think that it's a good idea to test if the table is visible in the viewport or not - so good direction. However, I'd propose merging the
areAnyRowsFullyInViewport
andareAnyColumnsFullyInViewport
methods to one that usesIntersectionObserver
API. The code would be much more simplified and bullet-proof. For example, code for both axes:Right now, there is a bug in those methods which appears in resulting wrongthis.visibilityObserver = new IntersectionObserver((entries) => { entries.forEach((entry) => { this.isOutsideOfViewport = !entry.isIntersecting; }); }, { root: null, });
true
/false
results. See the gif
- The main issue seems to be solved (that with the checkboxes in the list), but I think it's some sort of lucky code combination related to the bug in the above methods 😄 I've tried using the
IntersectionObserver
API, and the fast/slow render in and outside the viewport work as expected but the main issue still did not work. - The last thing. For viewport stuff, I think the best place for that code would be the
viewport.js
file. Thanks to that, you won't have to juggle arguments back and forth in the methodwtViewport.createRenderCalculators
within the WoT Table class.
As for
|
I'd be for more deeply investigating why there is a need for a gap for the last row and try to use the intersection observer idea. The current implementation seems to be covering some other bug. |
I'll get to it and try to elaborate more on the exact reason why this is happening 👍 |
@budnix
This, as a result, forces the table to perform full renders if the table is outside of the viewport or only the last row/column is visible. Removing the logic from #9542 would break instances with oversized cells taking up more than the width/height of the viewport - leaving it in and using the intersection observer would not resolve the issue from handsontable/dev-handsontable#561. Do you have any suggestions on how to move forward? |
I checked and confirmed that the 'Walkontable' tests pass in every supported environment while waiting for the review to end. |
Looks great! 🏅 Much cleaner than my initial idea. Would you make a PR of that branch so that we could merge it into this one? |
Something like that #10224? |
This reverts commit 75475dc.
…rowing the scope of the task.
…ontable into feature/dev-issue-561
…ontable into feature/dev-issue-561
As discussed, handsontable/dev-handsontable#1106 (marked as a blocker) is being postponed and is not fixed in this PR. handsontable/dev-handsontable#1107, however, should work all right after merging this PR. @budnix, could you re-review? |
…ontable into feature/dev-issue-561
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…e table is on the right the viewport.
…ontable into feature/dev-issue-561
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Context
As described in https://github.com/handsontable/dev-handsontable/issues/983, since
12.1.0
, the table triggers a "full" render with every scroll when the table is outside of the viewport.This PR aims to restore the state from
<12.1.0
- when outside the viewport, the table renders only using the "fast" mode.This should also fix the problem described in handsontable/dev-handsontable#561.
Additional to the added logic and tests, I removed the
lastSelectedColumn
property from the Filters plugin because I didn't find anything referencing it.How has this been tested?
Added test cases.
Types of changes
Related issue(s):
Affected project(s):
handsontable
@handsontable/angular
@handsontable/react
@handsontable/vue
@handsontable/vue3
Checklist: