fix(animation): carousel fails to scroll to bottom with fractional row heights - #5333
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
…ctional row/col heights - Run post-animation scroll correction for both integer and fractional scroll targets - Add post-animation correction for scrollToCol (consistent with scrollToRow) - Use Math.round instead of Math.floor in animation onUpdate to reduce pixel drift - Add explicit boundary check in carousel plugin to reliably reset at end of scroll range - Fixes TableCarouselAnimationPlugin failing to reach bottom when defaultRowHeight is a decimal value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 This is a ...
🔗 Related issue link
fix #4812
💡 Background and solution
When using
TableCarouselAnimationPluginwithdefaultRowHeightset to a decimal value (e.g., 34.666666666666664), the animation would fail to scroll to the bottom of the table and loop incorrectly.Root cause:
scrollToRowonly scheduled post-animation scroll position correction when the target row was an integer. For fractional scroll targets (used during animation for smooth sub-row positioning), the correction timer was skipped, leaving the final scrollTop slightly off due to cumulative Math.floor rounding during animation frames.screenTopRow !== this.rowto detect end-of-scroll, which could fail with fractional row positions when floating-point accumulation error caused a mismatch even though scrolling completed.Animateaaa.onUpdateusedMath.floorfor intermediate scroll offsets, causing a downward pixel drift over the animation duration.Fix:
scrollToColfor consistency withscrollToRow.Math.floortoMath.roundinAnimateaaa.onUpdateto minimize cumulative drift during animation.this.row >= this.table.rowCount - 1and col equivalent) in the carousel plugin to reliably reset to start when reaching end regardless of fractional drift.📝 Changelog
defaultRowHeightis a non-integer value☑️ Self-Check before Merge