hi-tm 0.8.8 → 0.8.9
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.
|
@@ -133,7 +133,12 @@ function CreatableSelect({ options = [], value, onChange, onClick, onValueChange
|
|
|
133
133
|
const inputRef = (0, react_1.useRef)(null);
|
|
134
134
|
// Sync external value (ids or option objects) with internal selectedValues state
|
|
135
135
|
(0, react_1.useEffect)(() => {
|
|
136
|
-
if
|
|
136
|
+
// Uncontrolled mode: if value is undefined, do not override internal state
|
|
137
|
+
if (value === undefined) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
// Explicit clear from parent
|
|
141
|
+
if (value === null) {
|
|
137
142
|
setSelectedValues([]);
|
|
138
143
|
return;
|
|
139
144
|
}
|