@uniai-fe/uds-primitives 0.5.1 → 0.5.2
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/package.json
CHANGED
|
@@ -139,12 +139,23 @@ export function SelectDefault<OptionData = unknown>({
|
|
|
139
139
|
// 7) 외부 items 변경 시 value 규칙으로 내부 선택 state를 재동기화한다.
|
|
140
140
|
useEffect(() => {
|
|
141
141
|
setUncontrolledSelectedValue(previousSelectedValue => {
|
|
142
|
+
if (
|
|
143
|
+
customOptions &&
|
|
144
|
+
isSameSelectedValue(
|
|
145
|
+
previousSelectedValue,
|
|
146
|
+
SELECT_CUSTOM_OPTION_VALUE,
|
|
147
|
+
) &&
|
|
148
|
+
selectedValueFromItems === undefined
|
|
149
|
+
) {
|
|
150
|
+
// 변경 설명: custom option은 mergedOptions에만 주입되므로 source items 재동기화가 첫 클릭 CUSTOM 상태를 지우지 않게 한다.
|
|
151
|
+
return previousSelectedValue;
|
|
152
|
+
}
|
|
142
153
|
if (isSameSelectedValue(previousSelectedValue, selectedValueFromItems)) {
|
|
143
154
|
return previousSelectedValue;
|
|
144
155
|
}
|
|
145
156
|
return selectedValueFromItems;
|
|
146
157
|
});
|
|
147
|
-
}, [selectedValueFromItems]);
|
|
158
|
+
}, [customOptions, selectedValueFromItems]);
|
|
148
159
|
|
|
149
160
|
// 8) value 기반으로 현재 선택 option을 계산한다.
|
|
150
161
|
const selectedOption = useMemo(
|