From 78bd5329e0db18d2395372ac9a907c5bdebc0a98 Mon Sep 17 00:00:00 2001 From: sunhao Date: Thu, 23 May 2024 15:08:34 +0800 Subject: [PATCH] * picker: fix selected item text now show in control with remote items. --- lib/picker/src/component/picker.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/picker/src/component/picker.tsx b/lib/picker/src/component/picker.tsx index 749024ce36..1466b09957 100644 --- a/lib/picker/src/component/picker.tsx +++ b/lib/picker/src/component/picker.tsx @@ -195,7 +195,11 @@ export class Picker = new Map(); + if (Array.isArray(prevState.items) && prevState.items !== newState.items) { + getValueMap(prevState.items as PickerItemOptions[], map); + } + getValueMap(items, map); newState.selections = this.formatValueList(newState.value ?? prevState.value).reduce((list, value) => { if (!this.isEmptyValue(value)) { list.push(map.get(value) || {value, text: value});