indicator-ui 0.0.61 → 0.0.62

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/dist/index.js CHANGED
@@ -9482,6 +9482,7 @@ function SelectField({ value, onChange, options = [], placeholder, isError, sear
9482
9482
  const [isFocus, setIsFocus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
9483
9483
  const [searchingString, setSearchingString] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('');
9484
9484
  const [isShowModalWindow, setIsShowModalWindow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
9485
+ const optionsCounter = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(options.length);
9485
9486
  const requestPromiseRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(undefined);
9486
9487
  // Добавляем кэширование выбранных options
9487
9488
  const optionsCacheRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]);
@@ -9545,11 +9546,10 @@ function SelectField({ value, onChange, options = [], placeholder, isError, sear
9545
9546
  requestPromiseRef.current = loadMoreOptions(optionsState?.length || 0, searchingString);
9546
9547
  }
9547
9548
  const newOptions = await requestPromiseRef.current;
9548
- if (requestPromise === undefined || requestPromise === requestPromiseRef.current) {
9549
- requestPromiseRef.current = undefined;
9550
- }
9551
- if (newOptions !== undefined)
9549
+ requestPromiseRef.current = undefined;
9550
+ if (newOptions !== undefined) {
9552
9551
  setOptionsState(prevState => [...prevState, ...newOptions]);
9552
+ }
9553
9553
  }
9554
9554
  };
9555
9555
  return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className?.selectField, children: [getViewField(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui__WEBPACK_IMPORTED_MODULE_6__.ModalWindowWrapper, { isShow: isShowModalWindow, setIsShow: setIsShowModalWindow, additionElements: [inputRef.current], className: className?.modalWindow, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_SelectModalWindow__WEBPACK_IMPORTED_MODULE_5__["default"], { value: value, options: optionsState, onChange: handleChange, afterElement: selectModalWindowAfterElement, onScrollToBottom: onScrollToBottom, className: className }) })] }));