Skip to content

Commit bcb9f90

Browse files
committed
Restored types for select
1 parent 22b4ae4 commit bcb9f90

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/lib/src/select/Select.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@ const DxcSelect = forwardRef<RefType, SelectPropsType>(
9797
const handleSelectChangeValue = (newOption: ListOptionType | undefined) => {
9898
if (newOption) {
9999
const currentValue = value ?? innerValue;
100+
// TODO: Fix types
100101
const newValue = multiple
101-
? Array.isArray(currentValue) && currentValue.includes(newOption.value)
102-
? currentValue.filter((optionVal: string) => optionVal !== newOption.value)
103-
: [...currentValue, newOption.value]
102+
? (currentValue as string[]).includes(newOption.value)
103+
? (currentValue as string[]).filter((optionVal: string) => optionVal !== newOption.value)
104+
: [...(currentValue as string[]), newOption.value]
104105
: newOption.value;
105106

106107
if (value == null) {

0 commit comments

Comments
 (0)