react-core-ts 2.1.21 → 2.1.23

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.
@@ -363,7 +363,7 @@ const AutoCompleteWithTabFilter = forwardRef<
363
363
  setShowToolsTab(false);
364
364
  setAllDataLoaded(false);
365
365
  if (!typeOnlyFetch) setSearchValue('');
366
- }, 200);
366
+ }, 0);
367
367
  }
368
368
  };
369
369
 
@@ -397,7 +397,7 @@ const AutoCompleteWithTabFilter = forwardRef<
397
397
  setShowToolsTab(false);
398
398
  setAllDataLoaded(false);
399
399
  if (!typeOnlyFetch) setSearchValue('');
400
- }, 200);
400
+ }, 0);
401
401
  }
402
402
  return;
403
403
  }
@@ -414,7 +414,7 @@ const AutoCompleteWithTabFilter = forwardRef<
414
414
  setShowToolsTab(false);
415
415
  setAllDataLoaded(false);
416
416
  if (!typeOnlyFetch) setSearchValue('');
417
- }, 200);
417
+ }, 0);
418
418
  }
419
419
  };
420
420
 
@@ -1145,7 +1145,7 @@ const AutoCompleteWithTabFilter = forwardRef<
1145
1145
  {!countOnly ? (
1146
1146
  getSelectedItems(false)
1147
1147
  ) : !tabInlineSearch ? (
1148
- <div className={`selected-items-counter-container selected-item-inline-counter qbs-text-sm qbs-gap-1 ${!tabInlineSearch && autoDropdown ? 'selected-item-tool-direct-counter' : ''}`}>
1148
+ <div className={`selected-items-counter-container selected-item-inline-counter ${disabled ? 'selected-item-inline-counter-disabled' : ''} qbs-text-sm qbs-gap-1 ${!tabInlineSearch && autoDropdown && !disabled ? 'selected-item-tool-direct-counter' : ''}`}>
1149
1149
  <Tooltip title={allSelectedTooltipContent} enabled={selectedItems?.length > 0 ? true : false}>
1150
1150
  <span className="badge qbs-rounded-full qbs-text-xs qbs-inline-flex qbs-items-center qbs-justify-center qbs-px-2 qbs-py-1 qbs-leading-none qbs-min-w-6 qbs-min-h-6">
1151
1151
  {selectedItems?.length}
@@ -1249,7 +1249,7 @@ const AutoCompleteWithTabFilter = forwardRef<
1249
1249
  />
1250
1250
  </div>
1251
1251
 
1252
- {enableToolsTab && (
1252
+ {enableToolsTab && !disabled && (
1253
1253
  <button
1254
1254
  disabled={disabled ?? readOnly}
1255
1255
  onClick={(e) => handleOpenToolsTab(e)}
@@ -115,6 +115,7 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
115
115
  bottom: 0,
116
116
  right: 0,
117
117
  });
118
+ const [isPositionReady, setIsPositionReady] = useState(false);
118
119
  const checkIncludes = (
119
120
  mainString: string,
120
121
  subString: string,
@@ -381,6 +382,10 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
381
382
  useEffect(() => {
382
383
  // Only attach scroll listeners when dropdown is open and rendered in portal
383
384
  if (insideOpen || !dropOpen) {
385
+ // Reset positioning flag when dropdown is closed
386
+ if (!dropOpen && isPositionReady) {
387
+ setIsPositionReady(false);
388
+ }
384
389
  return;
385
390
  }
386
391
 
@@ -647,6 +652,7 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
647
652
  bottom,
648
653
  width: inputRect.width,
649
654
  });
655
+ setIsPositionReady(true);
650
656
  }
651
657
 
652
658
  return undefined;
@@ -1042,9 +1048,13 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
1042
1048
  )}
1043
1049
  </div>
1044
1050
  </div>
1045
- {dropOpen && (!isLoading || filteredData?.length > 0) && (
1046
- <>{insideOpen ? setDropDown() : <Portal>{setDropDown()}</Portal>}</>
1047
- )}
1051
+ {dropOpen &&
1052
+ (!insideOpen ? isPositionReady : true) &&
1053
+ (!isLoading || filteredData?.length > 0) && (
1054
+ <>
1055
+ {insideOpen ? setDropDown() : <Portal>{setDropDown()}</Portal>}
1056
+ </>
1057
+ )}
1048
1058
  </div>
1049
1059
  </div>
1050
1060
  </div>
@@ -119,6 +119,7 @@ const ModernAutoCompleteDropdown: React.FC<AutoSuggestionInputProps> = ({
119
119
  bottom: 0,
120
120
  right: 0,
121
121
  });
122
+ const [isPositionReady, setIsPositionReady] = useState(false);
122
123
  const checkIncludes = (
123
124
  mainString: string,
124
125
  subString: string,
@@ -402,6 +403,10 @@ const ModernAutoCompleteDropdown: React.FC<AutoSuggestionInputProps> = ({
402
403
  useEffect(() => {
403
404
  // Only attach scroll listeners when dropdown is open and rendered in portal
404
405
  if (insideOpen || !dropOpen) {
406
+ // Reset positioning flag when dropdown is closed
407
+ if (!dropOpen && isPositionReady) {
408
+ setIsPositionReady(false);
409
+ }
405
410
  return;
406
411
  }
407
412
 
@@ -672,6 +677,7 @@ const ModernAutoCompleteDropdown: React.FC<AutoSuggestionInputProps> = ({
672
677
  bottom,
673
678
  width: inputRect.width,
674
679
  });
680
+ setIsPositionReady(true);
675
681
  }
676
682
 
677
683
  return undefined;
@@ -1079,9 +1085,13 @@ const ModernAutoCompleteDropdown: React.FC<AutoSuggestionInputProps> = ({
1079
1085
  )}
1080
1086
  </div>
1081
1087
  </div>
1082
- {dropOpen && (!isLoading || filteredData?.length > 0) && (
1083
- <>{insideOpen ? setDropDown() : <Portal>{setDropDown()}</Portal>}</>
1084
- )}
1088
+ {dropOpen &&
1089
+ (!insideOpen ? isPositionReady : true) &&
1090
+ (!isLoading || filteredData?.length > 0) && (
1091
+ <>
1092
+ {insideOpen ? setDropDown() : <Portal>{setDropDown()}</Portal>}
1093
+ </>
1094
+ )}
1085
1095
  </div>
1086
1096
  </div>
1087
1097
  </div>
@@ -514,7 +514,7 @@ const DropdownFilterTabs = forwardRef<
514
514
  setDropOpen(false);
515
515
  onToolClose?.();
516
516
  if (!typeOnlyFetch) setSearchValue('');
517
- }, 200);
517
+ }, 0);
518
518
  }
519
519
  };
520
520
 
@@ -538,7 +538,7 @@ const DropdownFilterTabs = forwardRef<
538
538
  setDropOpen(false);
539
539
  onToolClose?.();
540
540
  if (!typeOnlyFetch) setSearchValue('');
541
- }, 200);
541
+ }, 0);
542
542
  }
543
543
  return;
544
544
  }
@@ -554,7 +554,7 @@ const DropdownFilterTabs = forwardRef<
554
554
  setDropOpen(false);
555
555
  onToolClose?.();
556
556
  if (!typeOnlyFetch) setSearchValue('');
557
- }, 200);
557
+ }, 0);
558
558
  }
559
559
  };
560
560
 
@@ -440,6 +440,10 @@ ul {
440
440
  right: 30px;
441
441
  }
442
442
 
443
+ .selected-item-inline-counter-disabled {
444
+ right: 8px;
445
+ }
446
+
443
447
  .selected-item-tool-direct-counter {
444
448
  right: 60px;
445
449
  }