Skip to content

fix: use targeted item refresh when signal-bound item value changes (#23913) (CP: 25.1)#23922

Merged
Artur- merged 1 commit into25.1from
cherry-pick-23913-to-25.1-1773757833378
Mar 18, 2026
Merged

fix: use targeted item refresh when signal-bound item value changes (#23913) (CP: 25.1)#23922
Artur- merged 1 commit into25.1from
cherry-pick-23913-to-25.1-1773757833378

Conversation

@vaadin-bot
Copy link
Collaborator

This PR cherry-picks changes from the original PR #23913 to branch 25.1.

Original PR description

Thread old item identity through DataRefreshEvent so that KeyMapper can remap keys when an item is replaced with a new instance (different identity). This replaces the refreshAll() workaround with a targeted single-item refresh for signal-bound grid items.

Fixes vaadin/flow-components#8938

…23913)

- Add a two-argument `refreshItem(T newItem, T oldItem)` overload to `DataProvider`, `DataView`, and related classes, enabling targeted refresh when an item's identity changes (e.g., signal-bound items replaced with new instances)
- `DataRefreshEvent` now carries an optional old item reference via `getOldItem()`, allowing`DataCommunicator` and `KeyMapper` to remap from the old identity to the new one instead of failing to find the item
- `HierarchicalDataCommunicator` throws `UnsupportedOperationException` for identity-changing refreshes, deferring TreeGrid `bindItems` support to a future change

Fixes #8938
@sonarqubecloud
Copy link

@github-actions
Copy link

Test Results

 1 388 files  +1   1 388 suites  +1   1h 24m 15s ⏱️ - 1m 43s
 9 925 tests +2   9 854 ✅ +2  71 💤 ±0  0 ❌ ±0 
10 398 runs  +2  10 318 ✅ +2  80 💤 ±0  0 ❌ ±0 

Results for commit 2728078. ± Comparison against base commit b69351c.

@Artur- Artur- merged commit ed04eaa into 25.1 Mar 18, 2026
30 checks passed
@Artur- Artur- deleted the cherry-pick-23913-to-25.1-1773757833378 branch March 18, 2026 07:07
mshabarov added a commit that referenced this pull request Mar 18, 2026
mshabarov added a commit that referenced this pull request Mar 18, 2026
vaadin-bot pushed a commit that referenced this pull request Mar 18, 2026
mshabarov added a commit that referenced this pull request Mar 18, 2026
mshabarov added a commit that referenced this pull request Mar 19, 2026
@vaadin-bot
Copy link
Collaborator Author

This ticket/PR has been released with Vaadin 25.1.0-rc2.

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