Skip to content

fix: preserve scroll position in inverse mode - #434

Open
ayushdwivedi-stack wants to merge 1 commit into
ankeetmaini:masterfrom
ayushdwivedi-stack:master
Open

fix: preserve scroll position in inverse mode#434
ayushdwivedi-stack wants to merge 1 commit into
ankeetmaini:masterfrom
ayushdwivedi-stack:master

Conversation

@ayushdwivedi-stack

Copy link
Copy Markdown

Fixes #418

Summary

When new items are prepended in inverse mode, the scroll position was not compensated, causing the visible content to jump.

This change preserves the user's scroll position by:

  • Saving scrollHeight and scrollTop before loading more items.
  • Calculating the scroll height difference after new items are rendered.
  • Adjusting scrollTop by that difference.

Tests

  • Added a test for preserving scroll position after new items are loaded in inverse mode.
  • Verified existing inverse mode behavior.

Validation

  • 68 tests passed
  • TypeScript check passed

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.

inverse still not working correctly

1 participant