Skip to content

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

Merged
web-padawan merged 2 commits into
mainfrom
fix/virtualizer-preserve-scroll-position
Feb 11, 2025
Merged

web-padawan merged 2 commits into
mainfrom
fix/virtualizer-preserve-scroll-position

Conversation

@web-padawan

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

Copy link
Copy Markdown
Member

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
@sonarqubecloud

Copy link
Copy Markdown

@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
@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
…8671)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
web-padawan added a commit that referenced this pull request Feb 11, 2025
…8672)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.7.0.alpha10 and is also targeting the upcoming stable 24.7.0 version.

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 / Dialog with ComponentRenderer

5 participants