refactor!: only re-render affected rows on grid selection change#11397
refactor!: only re-render affected rows on grid selection change#11397
Conversation
Instead of requesting a full content update when selectedItems changes, only update the rows whose selection state actually changed. This avoids unnecessary re-rendering of all visible rows when selecting or deselecting a single item.
52e6f06 to
00d7c0b
Compare
|
There was a problem hiding this comment.
I guess there can be use-cases where value on some cells depend on the grid's selection state
Kapture.2026-03-21.at.14.12.40.mp4
There was a problem hiding this comment.
I think it should be the developer's responsibility to ensure renderers get triggered when selection changes. They could, for example, accomplish that by adding selectedItems to the renderer's deps:
.renderer="${bodyRenderer(() => `${selectedItems.length} selected`, [selectedItems])}"The fact that all renderers were automatically re-rendered on selection looks like an unintended side effect to me.
There was a problem hiding this comment.
I agree about it being the developer's responsibility, but since it has worked without additional wiring until now, changing it may cause some breakages. I'm not against the change, ideally something like this would be done for a new major though.



The PR optimizes
__selectedItemsChangedinSelectionMixinto only call__updateRowon rows whose selection state actually changed, instead of triggering a full content update for all rendered rows.