-
Notifications
You must be signed in to change notification settings - Fork 66
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
Select component uses old instance to refresh item #6579
Comments
Might need to be verified in e.g. |
There is possibly another issue with the See minimal example here: https:/MatthewVaadin/refresh-select Steps to reproduce:
|
Description
When Select reacts to a
DataChangeEvent
(i.e.DataProvider.refresh(item)
) the callback does not take into account the new item instance but it just re-render the existing instance.See in
flow-components/vaadin-select-flow-parent/vaadin-select-flow/src/main/java/com/vaadin/flow/component/select/Select.java
Lines 1017 to 1030 in 7000581
The
updatedItem
is only used to find the corresponding existingvaadinItem
and then theupdateItem
is invoked with the existingvaadinItem
instance, so that if anything has changed inupdatedItem
it’s just ignored.Expected outcome
Upon
DataChangeEvent
the new data is used to update the item.Minimal reproducible example
Steps to reproduce
The data provider needs to override the
getId
method so that thenewItem
instance matches an existing item, but the update still uses the old instance.Environment
Vaadin version(s): 24.5.0.alpha10
Browsers
No response
The text was updated successfully, but these errors were encountered: