@veritone-ce/design-system 2.5.13 → 2.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -185,13 +185,15 @@ function ControlledSelect({
|
|
|
185
185
|
label: option.label,
|
|
186
186
|
icon: option.icon,
|
|
187
187
|
onSelect(e) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
option.value
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
if (multiple) {
|
|
189
|
+
const multiValue = value || [];
|
|
190
|
+
const hasValue = multiValue && multiValue.some((val) => val === option.value);
|
|
191
|
+
if (!hasValue) {
|
|
192
|
+
props.onChange(e, [...multiValue, option.value]);
|
|
193
|
+
}
|
|
194
|
+
} else {
|
|
195
|
+
props.onChange(e, option.value);
|
|
196
|
+
}
|
|
195
197
|
props.onInputChange(e, "");
|
|
196
198
|
setOpen(false);
|
|
197
199
|
}
|
|
@@ -181,13 +181,15 @@ function ControlledSelect({
|
|
|
181
181
|
label: option.label,
|
|
182
182
|
icon: option.icon,
|
|
183
183
|
onSelect(e) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
option.value
|
|
189
|
-
|
|
190
|
-
|
|
184
|
+
if (multiple) {
|
|
185
|
+
const multiValue = value || [];
|
|
186
|
+
const hasValue = multiValue && multiValue.some((val) => val === option.value);
|
|
187
|
+
if (!hasValue) {
|
|
188
|
+
props.onChange(e, [...multiValue, option.value]);
|
|
189
|
+
}
|
|
190
|
+
} else {
|
|
191
|
+
props.onChange(e, option.value);
|
|
192
|
+
}
|
|
191
193
|
props.onInputChange(e, "");
|
|
192
194
|
setOpen(false);
|
|
193
195
|
}
|