@fixefy/fixefy-ui-components 0.2.30 → 0.2.32

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.
@@ -187,14 +187,10 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
187
187
  if (newOptions == null || newOptions.length < pageSize) {
188
188
  setIsLastPage(true);
189
189
  }
190
- if (reason === 'searched' || reason === 'init') {
191
- setOptions(newOptions);
192
- } else if (reason === 'loaded more') {
193
- setOptions((prevOptions)=>[
194
- ...prevOptions,
195
- ...newOptions
196
- ]);
197
- }
190
+ reason !== 'loaded more' ? setOptions(newOptions) : setOptions((prevOptions)=>[
191
+ ...prevOptions,
192
+ ...newOptions
193
+ ]);
198
194
  }
199
195
  }, [
200
196
  data,
@@ -233,9 +229,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
233
229
  if (storedDisplayed) {
234
230
  storedDisplayed = JSON.parse(storedDisplayed);
235
231
  if (multiple) {
236
- const newDisplayed = storedDisplayed[name].filter((opt)=>{
237
- opt[title_path] !== option[title_path];
238
- });
232
+ const newDisplayed = storedDisplayed[name].filter((opt)=>opt[title_path] !== option[title_path]);
239
233
  storedDisplayed[name] = newDisplayed;
240
234
  } else {
241
235
  delete storedDisplayed[name];
@@ -253,17 +247,20 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
253
247
  deleteOneItem(option);
254
248
  } else {
255
249
  onAdd && onAdd(option);
250
+ setIOpen(false);
256
251
  setDisplayed((prev)=>[
257
252
  ...prev,
258
253
  option
259
254
  ]);
260
255
  addToStoredDisplayed(option);
256
+ setIOpen(false);
261
257
  }
262
258
  break;
263
259
  default:
264
260
  setDisplayed(option);
265
261
  onAdd && onAdd(option);
266
262
  addToStoredDisplayed(option);
263
+ setIOpen(false);
267
264
  }
268
265
  };
269
266
  const deleteOneItem = (item)=>{
@@ -548,11 +545,6 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
548
545
  },
549
546
  onFocus: ()=>{
550
547
  !isInitialOpen && setIOpen(true);
551
- },
552
- onBlur: ()=>{
553
- setTimeout(()=>{
554
- !isInitialOpen && setIOpen(false);
555
- }, 200);
556
548
  }
557
549
  }),
558
550
  loading && /*#__PURE__*/ (0, _jsxruntime.jsx)(_dropdownstyles.Loading, {
package/package.json CHANGED
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.2.30"
68
+ "version": "0.2.32"
69
69
  }