@abgov/react-components 4.0.0-alpha.15 → 4.0.0-alpha.16

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.
@@ -24,8 +24,8 @@ declare global {
24
24
  }
25
25
  interface Props {
26
26
  name: string;
27
- value: string[];
28
- onChange: (name: string, values: string[]) => void;
27
+ value: string[] | string;
28
+ onChange: (name: string, values: string[] | string) => void;
29
29
  disabled?: boolean;
30
30
  filterable?: boolean;
31
31
  leadingIcon?: GoAIconType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "4.0.0-alpha.15",
3
+ "version": "4.0.0-alpha.16",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -365,9 +365,10 @@ const GoADropdown = props => {
365
365
  const handler = state => {
366
366
  const {
367
367
  name,
368
+ value,
368
369
  values
369
370
  } = state.detail;
370
- props.onChange(name, values);
371
+ props.onChange(name, props.multiselect ? values : value);
371
372
  };
372
373
 
373
374
  current.addEventListener('_change', handler);
@@ -398,8 +398,9 @@
398
398
  var handler = function handler(state) {
399
399
  var _a = state.detail,
400
400
  name = _a.name,
401
+ value = _a.value,
401
402
  values = _a.values;
402
- props.onChange(name, values);
403
+ props.onChange(name, props.multiselect ? values : value);
403
404
  };
404
405
 
405
406
  current.addEventListener('_change', handler);