Skip to content

AnalyticalTable: Scroll position not maintained on growing table with groupBy and infiniteScrolling enabled #6439

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

Closed
1 task done
fushizen opened this issue Oct 3, 2024 · 1 comment

Comments

@fushizen
Copy link

fushizen commented Oct 3, 2024

Describe the bug

On using an Analytical Table with infiniteScrolling and groupBy enabled, on scroll to load more data, the scroll position jumps back to the top of the table

Isolated Example

https://stackblitz.com/edit/ui5wcr-at-bvsfmh?file=src%2FApp.tsx

Reproduction steps

  1. Open the sandbox
  2. Scroll to the end of the grouped table
  3. Scroll position jumps to the top of the table on load of more data

Expected Behaviour

On scroll to load more data, scroll position should remain stationary on the page.

Screenshots or Videos

No response

UI5 Web Components for React Version

~1.29.11

UI5 Web Components Version

~1.24.10

Browser

Chrome, Edge, Firefox

Operating System

No response

Additional Context

No response

Relevant log output

No response

Organization

SAP

Declaration

  • I’m not disclosing any internal or sensitive information.
@Lukas742
Copy link
Contributor

Lukas742 commented Oct 4, 2024

Hi @fushizen

this behavior occurs because of two reasons:

  1. The table is programmatically expanding all rows, when the data is fetched, this internal table state is reset per default and that's why the table is scrolling to the top. To prevent this you can use autoResetExpanded: false.
  2. Different to "normal" tables, a grouped table does add new rows not necessarily at the end of the previous rows and therefore even with autoResetExpanded: false the scroll position can be off. Unfortunately, this is one of the reasons we don't recommend using grouping in combination with infinite scrolling. Some other limitations can be found in this PR, where we, i.a., outline this limitation more prominently.

StackBlitz example

When loading new data, you can try updating the scroll position yourself, by leveraging the scrollTo or scrollToItem method. (docs)

As there is unfortunately no design concept for this behavior and grouping was even deprecated for the SAPUI5 table, I'm going to close this issue now. If you have additional questions or feedback, please feel free to still post them here, as we also monitor closed issues.

@Lukas742 Lukas742 closed this as completed Oct 4, 2024
@Lukas742 Lukas742 added consulting and removed bug labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants