Skip to content

TableView with overflowMode="wrap": Scroll position jumps to top after asynchronous loads #8132

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

Open
obreitwi opened this issue Apr 23, 2025 · 0 comments · May be fixed by #8133
Open

TableView with overflowMode="wrap": Scroll position jumps to top after asynchronous loads #8132

obreitwi opened this issue Apr 23, 2025 · 0 comments · May be fixed by #8133

Comments

@obreitwi
Copy link

Provide a general summary of the issue here

When using react-spectrum's TableView with an asynchronous list as data source and overflowMode set to "wrap", the TableView's scroll position jumps to the top on each trigger of onLoadMore.

🤔 Expected Behavior?

Same as with overflowMode="truncate", TableView should keep its (relative) vertical scrolling position after loading new data.

😯 Current Behavior

If overflowMode="wrap", TableView's vertical scroll position jumps to the top on each asynchronous load.

If overflowMode="truncate", TableView's vertical scroll position is kept unchanged and the user can continue scrolling.

💁 Possible Solution

After loading new data, the table layout is updated. During this, a check for updated columnWidths is performed.

However, we only check if the two columnWidths objects differ and not whether actual column widths are different, leading to an invalidation of all cached nodes in the corresponding Virtualizer.

🔦 Context

We are using TableView to display a lot of elements of varying row heights.

🖥️ Steps to Reproduce

(pending)

Version

3.41.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Linux, Windows

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@obreitwi obreitwi linked a pull request Apr 23, 2025 that will close this issue
5 tasks
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 a pull request may close this issue.

1 participant