@tidbcloud/uikit 2.0.7 → 2.0.8

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tidbcloud/uikit
2
2
 
3
+ ## 2.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(uikit): adjust Select component null value handling ([#456](https://github.com/tidbcloud/tidbcloud-uikit/pull/456))
8
+
3
9
  ## 2.0.7
4
10
 
5
11
  ### Patch Changes
@@ -15,8 +15,7 @@ function useCreateableSelect(props) {
15
15
  throw new Error("`onCreate` is required when `creatable` is true");
16
16
  }
17
17
  const [value, setValue] = useUncontrolled.useUncontrolled({
18
- value: props.value || null,
19
- // use null value to clear input
18
+ value: props.value,
20
19
  onChange: props.onChange,
21
20
  defaultValue: props.defaultValue
22
21
  });
@@ -76,7 +75,7 @@ function useCreateableSelect(props) {
76
75
  }
77
76
  function Select(props) {
78
77
  const allProps = useCreateableSelect(props);
79
- return /* @__PURE__ */ jsxRuntime.jsx(Select$1.Select, { ...allProps });
78
+ return /* @__PURE__ */ jsxRuntime.jsx(Select$1.Select, { ...allProps, value: props.value || null });
80
79
  }
81
80
  function MultiSelect(props) {
82
81
  const allProps = useCreateableSelect(props);
@@ -13,8 +13,7 @@ function useCreateableSelect(props) {
13
13
  throw new Error("`onCreate` is required when `creatable` is true");
14
14
  }
15
15
  const [value, setValue] = useUncontrolled({
16
- value: props.value || null,
17
- // use null value to clear input
16
+ value: props.value,
18
17
  onChange: props.onChange,
19
18
  defaultValue: props.defaultValue
20
19
  });
@@ -74,7 +73,7 @@ function useCreateableSelect(props) {
74
73
  }
75
74
  function Select(props) {
76
75
  const allProps = useCreateableSelect(props);
77
- return /* @__PURE__ */ jsx(Select$1, { ...allProps });
76
+ return /* @__PURE__ */ jsx(Select$1, { ...allProps, value: props.value || null });
78
77
  }
79
78
  function MultiSelect(props) {
80
79
  const allProps = useCreateableSelect(props);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",