@ultraviolet/form 2.12.0 → 2.13.0

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.
@@ -1,4 +1,5 @@
1
1
  import { SelectInputV2 } from '@ultraviolet/ui';
2
+ import { useCallback } from 'react';
2
3
  import { useController } from 'react-hook-form';
3
4
  import { jsx } from '@emotion/react/jsx-runtime';
4
5
  import { useErrors } from '../../providers/ErrorContext/index.js';
@@ -54,6 +55,10 @@ const SelectInputFieldV2 = ({
54
55
  const {
55
56
  getError
56
57
  } = useErrors();
58
+ const handleChange = useCallback(value => {
59
+ onChange?.(value);
60
+ field.onChange(value);
61
+ }, [onChange, field]);
57
62
  return jsx(SelectInputV2, {
58
63
  name: field.name,
59
64
  options: options,
@@ -71,13 +76,13 @@ const SelectInputFieldV2 = ({
71
76
  },
72
77
  placeholder: placeholder,
73
78
  readOnly: readOnly,
79
+ multiselect: multiselect,
74
80
  value: field.value,
75
81
  placeholderSearch: placeholderSearch,
76
82
  helper: helper,
77
83
  emptyState: emptyState,
78
84
  searchable: searchable,
79
85
  clearable: clearable,
80
- multiselect: multiselect,
81
86
  descriptionDirection: descriptionDirection,
82
87
  footer: footer,
83
88
  labelDescription: labelDescription,
@@ -92,10 +97,7 @@ const SelectInputFieldV2 = ({
92
97
  autofocus: autofocus,
93
98
  optionalInfoPlacement: optionalInfoPlacement,
94
99
  "aria-label": ariaLabel,
95
- onChange: value => {
96
- field.onChange(value);
97
- onChange?.(value);
98
- }
100
+ onChange: handleChange
99
101
  });
100
102
  };
101
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/form",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Ultraviolet Form",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -53,7 +53,7 @@
53
53
  "@emotion/styled": "11.11.5",
54
54
  "react-select": "5.8.0",
55
55
  "react-hook-form": "7.51.3",
56
- "@ultraviolet/ui": "1.49.0"
56
+ "@ultraviolet/ui": "1.50.0"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "rollup -c ../../rollup.config.mjs",