@bolttech/molecules-dropdown 0.37.5 → 0.37.6
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/index.cjs.js +2 -2
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -3387,7 +3387,7 @@ const Dropdown = /*#__PURE__*/react.forwardRef((_a, ref) => {
|
|
|
3387
3387
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3388
3388
|
}, [internalSelectedOption]);
|
|
3389
3389
|
react.useEffect(() => {
|
|
3390
|
-
if (value !== (internalSelectedOption === null || internalSelectedOption === void 0 ? void 0 : internalSelectedOption.id)) {
|
|
3390
|
+
if (value !== (internalSelectedOption === null || internalSelectedOption === void 0 ? void 0 : internalSelectedOption.id) && Array.isArray(optionList)) {
|
|
3391
3391
|
const foundOption = optionList === null || optionList === void 0 ? void 0 : optionList.find(option => option.id === value);
|
|
3392
3392
|
if (!value && internalSelectedOption) {
|
|
3393
3393
|
setInternalSelectedOption(undefined);
|
|
@@ -3401,7 +3401,7 @@ const Dropdown = /*#__PURE__*/react.forwardRef((_a, ref) => {
|
|
|
3401
3401
|
}
|
|
3402
3402
|
}
|
|
3403
3403
|
}
|
|
3404
|
-
if (!isFirstRender || currentOptionList.length === 0) return;
|
|
3404
|
+
if (!Array.isArray(currentOptionList) || !isFirstRender || currentOptionList.length === 0) return;
|
|
3405
3405
|
setInternalSelectedOption(currentOptionList.find(option => option.id === value));
|
|
3406
3406
|
setIsFirstRender(false);
|
|
3407
3407
|
}, [currentOptionList, setSelectedOptionOnInputValue, value, internalSelectedOption, optionList, isFirstRender, onKeyUp, onKeyDown, asyncOptionList]);
|