vaadin-component-factory / combo-box-light

Light ComboBox without lazy loading feature
Other
0 stars 1 forks source link

updateSelectedKey is outdated #2

Closed stefanuebe closed 1 week ago

stefanuebe commented 1 week ago

With V24 it seems like the combobox has no "_selectedKey" anymore, but uses the "value" property instead to define, which item should be shown as selected.

Therefore updateSelectedKey should set the "value" property with the up-to-date keymapper key to prevent the client side to "forget" the selected value, when updating the items.

Sample to reproduce the issue is to set the item label generator after the value has been set.

var light = new ComboBoxLight<SamplePerson>();
light.setItems(LIST);
light.setValue(LIST.get(0));
light.setItemLabelGenerator(SamplePerson::getName);
add(light);
TatuLund commented 1 week ago

Fixed in version 2.0.0