@linzjs/lui 21.44.3 → 21.44.5-0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [21.44.4](https://github.com/linz/lui/compare/v21.44.3...v21.44.4) (2024-08-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **LuiSearchBox:** search results panel closed when click arrows to scroll up and down ([#1151](https://github.com/linz/lui/issues/1151)) ([d75b9a1](https://github.com/linz/lui/commit/d75b9a1fe525db4b1bec56142d326ac3000108da))
7
+
1
8
  ## [21.44.3](https://github.com/linz/lui/compare/v21.44.2...v21.44.3) (2024-08-27)
2
9
 
3
10
 
package/dist/index.js CHANGED
@@ -42541,11 +42541,11 @@ var LuiSearchInput = function (props) {
42541
42541
  return __generator(this, function (_b) {
42542
42542
  switch (_b.label) {
42543
42543
  case 0:
42544
- if (!(input !== '' && input.length >= props.minCharactersForSearch)) return [3 /*break*/, 5];
42544
+ if (!(input !== '' && input.length >= props.minCharactersForSearch)) return [3 /*break*/, 6];
42545
42545
  setIsLoading(true);
42546
42546
  _b.label = 1;
42547
42547
  case 1:
42548
- _b.trys.push([1, , 3, 4]);
42548
+ _b.trys.push([1, 3, 4, 5]);
42549
42549
  return [4 /*yield*/, props.getOptions(input)];
42550
42550
  case 2:
42551
42551
  results_1 = _b.sent();
@@ -42555,12 +42555,17 @@ var LuiSearchInput = function (props) {
42555
42555
  if (!selectedIdInResults) {
42556
42556
  setSelectedId(items.length ? items[0].id : '');
42557
42557
  }
42558
- return [3 /*break*/, 4];
42558
+ return [3 /*break*/, 5];
42559
42559
  case 3:
42560
+ _b.sent();
42561
+ // failed to get results, clear the last search results to avoid misleading
42562
+ setResults([]);
42563
+ return [3 /*break*/, 5];
42564
+ case 4:
42560
42565
  setIsLoading(false);
42561
42566
  return [7 /*endfinally*/];
42562
- case 4: return [3 /*break*/, 6];
42563
- case 5:
42567
+ case 5: return [3 /*break*/, 7];
42568
+ case 6:
42564
42569
  if (input !== '' &&
42565
42570
  input.length < props.minCharactersForSearch &&
42566
42571
  results.length > 0) {
@@ -42571,8 +42576,8 @@ var LuiSearchInput = function (props) {
42571
42576
  (_a = props.onClearCallback) === null || _a === void 0 ? void 0 : _a.call(props);
42572
42577
  setResults([]);
42573
42578
  }
42574
- _b.label = 6;
42575
- case 6: return [2 /*return*/];
42579
+ _b.label = 7;
42580
+ case 7: return [2 /*return*/];
42576
42581
  }
42577
42582
  });
42578
42583
  });