diff --git a/src/select/_example/label-in-value.tsx b/src/select/_example/label-in-value.tsx index f5fd93b85a..0616611a38 100644 --- a/src/select/_example/label-in-value.tsx +++ b/src/select/_example/label-in-value.tsx @@ -47,6 +47,7 @@ const LabelInValueSelect = () => { valueType="object" keys={{ label: 'text', value: 'data' }} options={[ + { text: 'Select All', checkAll: true }, { text: 'Apple', data: 'apple', type: 'fruit' }, { text: 'Orange', data: 'orange', type: 'fruit' }, { text: 'Banana', data: 'banana', type: 'fruit' }, diff --git a/src/select/base/Select.tsx b/src/select/base/Select.tsx index 42b37260c5..26924dccd7 100644 --- a/src/select/base/Select.tsx +++ b/src/select/base/Select.tsx @@ -191,9 +191,9 @@ const Select = forwardRefWithStatics( if (!multiple) { return; } - const selectableOptions = currentOptions - .filter((option) => !option.checkAll && !option.disabled) - .map((option) => option.value); + + const values = currentOptions.filter((option) => !option.checkAll && !option.disabled) + const selectableOptions = getSelectedOptions(values, multiple, valueType, keys, tmpPropOptions) const checkAllValue = !checkAll && selectableOptions.length !== (props.value as Array)?.length ? selectableOptions : [];