Skip to content
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

fix: restore scroll position when virtualizer host is connected #8642

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

web-padawan
Copy link
Member

@web-padawan web-padawan commented Feb 5, 2025

Description

Fixes #8630

Related to #6431 (comment)

When an element using virtualizer (e.g. virtual-list or grid) is used in dialog or other overlay, it is moved within DOM while also changing visibility. Added ResizeObserver to handle this case and restore scrollTop, which gets reset whenever the element gets disconnected from the DOM. This fixes the problem of empty items after dialog reopening.

Type of change

  • Bugfix

@web-padawan web-padawan force-pushed the fix/virtualizer-preserve-scroll-position branch from 2872a35 to 0fb7bb7 Compare February 10, 2025 11:58
@web-padawan web-padawan changed the title fix: restore scroll position when virtualizer used in dialog fix: restore scroll position when virtualizer host is connected Feb 10, 2025
@web-padawan web-padawan force-pushed the fix/virtualizer-preserve-scroll-position branch from 324e4ad to 0fb7bb7 Compare February 11, 2025 09:32
@web-padawan web-padawan removed the request for review from vursen February 11, 2025 10:10
@web-padawan web-padawan merged commit 36c95c7 into main Feb 11, 2025
16 of 17 checks passed
@web-padawan web-padawan deleted the fix/virtualizer-preserve-scroll-position branch February 11, 2025 10:11
web-padawan added a commit that referenced this pull request Feb 11, 2025
web-padawan added a commit that referenced this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Virtual List rendering issue in Popover
5 participants