Skip to content

[WC-3396][WC-3349] Allow row "keys" to be defined by the user#2186

Open
r0b1n wants to merge 3 commits intodg-scroll-againfrom
feat/stable-row-key
Open

[WC-3396][WC-3349] Allow row "keys" to be defined by the user#2186
r0b1n wants to merge 3 commits intodg-scroll-againfrom
feat/stable-row-key

Conversation

@r0b1n
Copy link
Copy Markdown
Collaborator

@r0b1n r0b1n commented Apr 22, 2026

Pull request type

New feature (non-breaking change which adds functionality)


Description

When using view entities in DataGrid 2, the grid jumps to the top after every data refresh in virtual scrolling mode. This happens because view entities get new GUIDs on every fetch, causing React to treat rows as completely new elements and remount them, losing the scroll position.

Added a new "Custom row key" property in the Advanced section that allows developers to define a stable identifier for each row using an expression. When configured, the grid uses this custom key instead of objectItem.id for React keys, preventing unnecessary re-renders and maintaining scroll position.

r0b1n added 3 commits April 22, 2026 10:54
there is no real reason to, it will work without it because it is scoped
this prevents scrolling issue when view entities update
@r0b1n r0b1n requested a review from a team as a code owner April 22, 2026 09:14
@r0b1n r0b1n changed the title [WC-3396] Allow row "keys" to be defined by the user [WC-3396][WC-3349] Allow row "keys" to be defined by the user Apr 22, 2026
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.

2 participants