@bitrise/bitkit 13.218.0 → 13.220.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.218.0",
4
+ "version": "13.220.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -354,13 +354,19 @@ const Dropdown = forwardRef<Element, DropdownProps<string | null>>(
354
354
  const searchElement = search === false ? null : search || <DropdownSearch />;
355
355
  const buttonId = useId();
356
356
 
357
+ const onScrolledToBottomRef = useRef(onScrolledToBottom);
358
+
359
+ useEffect(() => {
360
+ onScrolledToBottomRef.current = onScrolledToBottom;
361
+ }, [onScrolledToBottom]);
362
+
357
363
  const internalRef = useCallback((node: HTMLDivElement | null) => {
358
364
  if (!node) return;
359
365
 
360
366
  const handleScroll = () => {
361
367
  const { scrollTop, scrollHeight, clientHeight } = node;
362
368
  if (scrollTop + clientHeight >= scrollHeight) {
363
- onScrolledToBottom?.();
369
+ onScrolledToBottomRef.current?.();
364
370
  }
365
371
  };
366
372
 
@@ -415,9 +421,11 @@ const Dropdown = forwardRef<Element, DropdownProps<string | null>>(
415
421
  {searchElement}
416
422
  <chakra.div ref={mergedRef} __css={dropdownStyles.options} tabIndex={-1}>
417
423
  {children}
418
- <chakra.div display="flex" justifyContent="space-around">
419
- <ProgressSpinner />
420
- </chakra.div>
424
+ {onScrolledToBottom && (
425
+ <chakra.div display="flex" justifyContent="space-around">
426
+ <ProgressSpinner />
427
+ </chakra.div>
428
+ )}
421
429
  </chakra.div>
422
430
  </chakra.div>
423
431
  </FloatingFocusManager>
@@ -27,7 +27,6 @@ export interface DropdownProps<T> extends ChakraProps {
27
27
  infoTooltipLabel?: string;
28
28
  infoTooltipProps?: TooltipProps;
29
29
  isError?: boolean;
30
- isLoadingMore?: boolean;
31
30
  isWarning?: boolean;
32
31
  label?: string;
33
32
  name?: string;