Skip to content

refactor: support scrolling in tree mode#655

Draft
spike-rabbit wants to merge 1 commit intomainfrom
refactor/datatable/scrolling-with-tree
Draft

refactor: support scrolling in tree mode#655
spike-rabbit wants to merge 1 commit intomainfrom
refactor/datatable/scrolling-with-tree

Conversation

@spike-rabbit
Copy link
Copy Markdown
Member

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

Scrolling to item does not support tree mode.

What is the new behavior?

Scrolling to item supports tree mode.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

Actually a feature, but since we did not release scrolling at all it is labeled as refactor.

It basically works as scrolling in the normal mode. The only difference is that in tree mode we may need to expand rows before scrolling.

@spike-rabbit spike-rabbit requested a review from a team as a code owner March 26, 2026 19:38
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements scrolling functionality for tree-structured data in the datatable component, including a utility to expand parent rows and corresponding unit tests. The review feedback points out a logic flaw in the scrollToRow method where the function continues execution after calling the tree-specific scroll handler, which leads to redundant operations and potential double-scrolling. Additionally, a performance concern was raised regarding the expandToRow utility, which rebuilds a lookup map on every call; the reviewer suggests optimizing this by pre-calculating the map to handle large datasets more efficiently.

Comment thread projects/ngx-datatable/src/lib/components/datatable.component.ts
Comment thread projects/ngx-datatable/src/lib/utils/tree.ts
Actually a feature, but since we did not release scrolling at all
it is labeled as refactor.

This adds scrolling for the tree mode.
It basically works as scrolling in the normal mode.
The only difference is that in tree mode we may need to expand rows before scrolling.
@spike-rabbit spike-rabbit force-pushed the refactor/datatable/scrolling-with-tree branch from 51d3eee to 2cfdc91 Compare March 27, 2026 08:01
@fh1ch fh1ch marked this pull request as draft April 1, 2026 10:24
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.

1 participant