Skip to content

Commit

Permalink
fix(select): 多选下拉框全选功能失效
Browse files Browse the repository at this point in the history
  • Loading branch information
huangchen1031 committed Nov 19, 2024
1 parent aec8d37 commit af78ae1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/select/base/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ const Select = forwardRefWithStatics(
return;
}

const values = currentOptions.filter((option) => !option.checkAll && !option.disabled)
const selectableOptions = getSelectedOptions(values, multiple, valueType, keys, tmpPropOptions)
const values = currentOptions
.filter((option) => !option.checkAll && !option.disabled)
.map((option) => option[keys?.value || 'value']);
const selectableOptions = getSelectedOptions(values, multiple, valueType, keys, tmpPropOptions);

const checkAllValue =
!checkAll && selectableOptions.length !== (props.value as Array<SelectOption>)?.length ? selectableOptions : [];
Expand Down

0 comments on commit af78ae1

Please sign in to comment.