Wait for animation frame before measuring Tabulator page size - #8390
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses an issue where Tabulator's page size calculation performs incorrectly in certain setups, resulting in an improperly measured page size. The fix delays the measurement of row height until after an animation frame by wrapping the recompute_page_size() call with requestAnimationFrame.
Changes:
- Modified
_resize_redraw()method to delay page size calculation until after an animation frame - Added semicolon to
restore_scroll()call for consistency
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| this.restore_scroll() | ||
| this.recompute_page_size() | ||
| this.restore_scroll(); | ||
| (window as any).requestAnimationFrame(() => this.recompute_page_size()) |
There was a problem hiding this comment.
The cast (window as any) is unnecessary here. Other files in the codebase (such as panel/models/column.ts, panel/models/feed.ts, panel/models/layout.ts, and panel/models/modal.ts) use requestAnimationFrame directly without this cast. For consistency with the rest of the codebase, you should call requestAnimationFrame(() => this.recompute_page_size()) directly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8390 +/- ##
==========================================
- Coverage 86.10% 86.09% -0.02%
==========================================
Files 349 349
Lines 54845 54845
==========================================
- Hits 47227 47219 -8
- Misses 7618 7626 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In some setups the Tabulator page size calculation doesn't perform well and you end up with an incorrectly measured page size. This aims to improve that by delaying the measurement of the row height until after an animation frame.