@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
- props.onChange(
189
- e,
190
- multiple ? [
191
- ...value ?? [],
192
- option.value
193
- ] : option.value
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
- props.onChange(
185
- e,
186
- multiple ? [
187
- ...value ?? [],
188
- option.value
189
- ] : option.value
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritone-ce/design-system",
3
- "version": "2.5.13",
3
+ "version": "2.5.14",
4
4
  "private": false,
5
5
  "description": "Design System for Veritone CE",
6
6
  "keywords": [