Posted 10 February 2022, 1:20 am EST
Hello,
You may handle the isDroppedDownChanged and itemsSourceChanged event of the ComboBox to store and restore the selectedItem respectively. Please refer to the code snippet and sample link below for reference:
theComboObject.isDroppedDownChanged.addHandler((s, e) => {
//store pre-selected item
preSelectedItem = theComboObject.selectedItem;
});
theComboObject.itemsSourceChanged.addHandler((s, e) => {
//restore the selected item
theComboObject.selectedItem = theComboObject.itemsSource.find(
(i) => i.id == preSelectedItem.id
);
});
Sample link:Js (forked) - StackBlitz
Regards