Repository navigation
fix(useInfiniteScroll): support column-reverse scroll origins - #2986
Open
Jarvis636431 wants to merge 1 commit into
Open
Jarvis636431 wants to merge 1 commit into
Jarvis636431 wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Fixes #2948
💡 Background and solution
In a flex container with
flex-direction: column-reverse, scrolling towards the list end produces a negativescrollTop.useInfiniteScrolltreats that value as a normal positive offset, so automatic loading does not trigger correctly and restoring the position after prepending uses the wrong sign.Detect flex/inline-flex column-reverse containers, normalize the scroll distance for the existing threshold and movement checks, and restore the signed offset after prepending. Loading continues to follow list order:
bottomappends at the list end (visual top in a reversed column), whiletopprepends at the list start (visual bottom). Document this in English and Chinese. No new option, dependency or change to normal-layout list ordering.Validation
REACT_MODE=strict: 96 files / 478 tests passed in each mode (Node 24.21.0).scrollTopfrom -20 to -170 with 0px anchor displacement, with browser scroll anchoring disabled. Normal-layout controls passed. Other browser engines and mobile devices were not tested.git diff --checkpassed. The source's existing exhaustive-dependencies lint error forisNoMoreremains; that memo was not changed. Build emits existing toolchain warnings.AI assistance was used for implementation and validation.
📝 Changelog
useInfiniteScrollfor column-reverse flex containers.useInfiniteScroll在 column-reverse 弹性布局中的自动加载判断和滚动位置恢复。☑️ Self Check before Merge