@sprinklrjs/spaceweb 14.12.0 → 14.12.1

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.
@@ -11,6 +11,7 @@ var uniqueId_1 = tslib_1.__importDefault(require("lodash/uniqueId"));
11
11
  var select_1 = require("../../select");
12
12
  //hooks
13
13
  var useLatest_1 = require("../../hooks/useLatest");
14
+ var useUpdateEffect_1 = tslib_1.__importDefault(require("../../hooks/useUpdateEffect"));
14
15
  var helpers_1 = require("../helpers");
15
16
  var constants_1 = require("../../select/constants");
16
17
  var useAsyncOptionHandlers = function (_a) {
@@ -135,12 +136,12 @@ var useAsyncOptionHandlers = function (_a) {
135
136
  return ({ group: id, pageNumber: 0 });
136
137
  }));
137
138
  }, [fetchOptions, groupConfig, minimumInputRef, resetAsyncSelectState, setIsLoading]);
138
- (0, react_1.useEffect)(function () {
139
+ (0, useUpdateEffect_1.default)(function () {
139
140
  if (!refetchOnGroupConfigChange) {
140
141
  return;
141
142
  }
142
143
  groupConfigIdRef.current = (0, uniqueId_1.default)();
143
- if (inputValueRef.current && inputValueRef.current.length >= minimumInputRef.current) {
144
+ if (inputValueRef.current.length >= minimumInputRef.current) {
144
145
  setIsLoading(true);
145
146
  resetAsyncSelectState();
146
147
  fetchOptions(groupConfig.map(function (_a) {
@@ -2,12 +2,13 @@ import { __assign, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
2
  /**
3
3
  * Created by Aneree on 15/01/21.
4
4
  */
5
- import { useRef, useCallback, useState, useEffect } from 'react';
5
+ import { useRef, useCallback, useState } from 'react';
6
6
  import _uniqueId from 'lodash/uniqueId';
7
7
  //components
8
8
  import { LOADING_KEY } from '../../select';
9
9
  //hooks
10
10
  import { useLatest } from '../../hooks/useLatest';
11
+ import useUpdateEffect from '../../hooks/useUpdateEffect';
11
12
  import { shouldPaginate, initGroupOptions, arrayToGroupedOptions } from '../helpers';
12
13
  import { UNGROUPED_ID } from '../../select/constants';
13
14
  var useAsyncOptionHandlers = function (_a) {
@@ -132,12 +133,12 @@ var useAsyncOptionHandlers = function (_a) {
132
133
  return ({ group: id, pageNumber: 0 });
133
134
  }));
134
135
  }, [fetchOptions, groupConfig, minimumInputRef, resetAsyncSelectState, setIsLoading]);
135
- useEffect(function () {
136
+ useUpdateEffect(function () {
136
137
  if (!refetchOnGroupConfigChange) {
137
138
  return;
138
139
  }
139
140
  groupConfigIdRef.current = _uniqueId();
140
- if (inputValueRef.current && inputValueRef.current.length >= minimumInputRef.current) {
141
+ if (inputValueRef.current.length >= minimumInputRef.current) {
141
142
  setIsLoading(true);
142
143
  resetAsyncSelectState();
143
144
  fetchOptions(groupConfig.map(function (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprinklrjs/spaceweb",
3
- "version": "14.12.0",
3
+ "version": "14.12.1",
4
4
  "description": "Components for SpaceWeb",
5
5
  "main": "index.js",
6
6
  "module": "./esm/index.js",
@@ -100,7 +100,7 @@
100
100
  "ts-node": "^10.4.0"
101
101
  },
102
102
  "peerDependencies": {
103
- "@sprinklrjs/spaceweb-themes": "14.12.0",
103
+ "@sprinklrjs/spaceweb-themes": "14.12.1",
104
104
  "react": ">=17.0.2 <19.0.0",
105
105
  "react-dom": ">=17.0.2 <19.0.0"
106
106
  }