Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
73f135f
Adding pagination for components dropdown
dannyroosevelt Oct 10, 2025
7da8685
fixing bug re: switching accounts not calling configureProp
dannyroosevelt Oct 10, 2025
7797c99
Update RemoteOptionsContainer.tsx
dannyroosevelt Oct 10, 2025
ef92539
Update RemoteOptionsContainer.tsx
dannyroosevelt Oct 10, 2025
0e1bb8b
Update RemoteOptionsContainer.tsx
dannyroosevelt Oct 10, 2025
59507f0
Merge branch 'master' into danny/connect-react/adding-pagination
dannyroosevelt Oct 10, 2025
ebb56ee
code cleanup
dannyroosevelt Oct 10, 2025
4c8b501
Merge branch 'danny/connect-react/adding-pagination' of github.com:Pi…
dannyroosevelt Oct 10, 2025
be246c9
linting fixes
dannyroosevelt Oct 10, 2025
9c3f0a5
Code cleanup
dannyroosevelt Oct 10, 2025
d89192f
Codex code cleanup
dannyroosevelt Oct 11, 2025
d63c51b
Update CHANGELOG.md
dannyroosevelt Oct 14, 2025
2a6c7fd
Merge branch 'master' into danny/connect-react/adding-pagination
dannyroosevelt Oct 14, 2025
226c3f4
addressing PR feedback from code rabbit
dannyroosevelt Oct 14, 2025
bb7651a
More PR feedback
dannyroosevelt Oct 14, 2025
2f04a2f
Linting and PR feedback
dannyroosevelt Oct 14, 2025
8e3b626
Merge branch 'master' into danny/connect-react/adding-pagination
dannyroosevelt Oct 14, 2025
494340a
PR feedback
dannyroosevelt Oct 14, 2025
34ff67d
Code cleanup
dannyroosevelt Oct 14, 2025
818ab71
Update use-mounted-ref.ts
dannyroosevelt Oct 14, 2025
1999db2
Merge branch 'master' into danny/connect-react/adding-pagination
jverce Oct 15, 2025
ea8a408
Merge branch 'master' into danny/connect-react/adding-pagination
dannyroosevelt Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/connect-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

# Changelog

## [2.1.0] - 2025-10-10

### Added

- Added infinite scroll (with pagination) for `SelectApp` and `SelectComponent` dropdowns
- Increased default page size to 50 items per request for better UX

### Fixed

- Remote options now properly reset when parent props change (e.g., switching accounts)

## [2.0.0] - 2025-10-02

### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/connect-react",
"version": "2.0.0",
"version": "2.1.0",
"description": "Pipedream Connect library for React",
"files": [
"dist"
Expand Down
72 changes: 51 additions & 21 deletions packages/connect-react/src/components/ControlSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
useEffect,
useMemo,
useState,
useRef,
} from "react";
import type {
CSSObjectWithLabel, MenuListProps,
Expand Down Expand Up @@ -112,30 +113,58 @@ export function ControlSelect<T extends PropOptionValue>({
selectOptions,
]);

const LoadMore = ({
// eslint-disable-next-line react/prop-types
children, ...props
}: MenuListProps<LabelValueOption<T>, boolean>) => {
return (
<components.MenuList {...props}>
{children}
<div className="pt-4">
<LoadMoreButton onChange={onLoadMore || (() => { })} />
</div>
</components.MenuList>
)
}

const props = select.getProps("controlSelect", baseSelectProps)

const finalComponents = {
...props.components,
...componentsOverride,
};
// Use ref to store latest onLoadMore callback
// This allows stable component reference while calling current callback
const onLoadMoreRef = useRef(onLoadMore);
useEffect(() => {
onLoadMoreRef.current = onLoadMore;
}, [
onLoadMore,
]);

if (showLoadMoreButton) {
finalComponents.MenuList = LoadMore;
}
// Use ref to store latest showLoadMoreButton value
const showLoadMoreButtonRef = useRef(showLoadMoreButton);
useEffect(() => {
showLoadMoreButtonRef.current = showLoadMoreButton;
}, [
showLoadMoreButton,
]);

// Memoize custom components to prevent remounting
// Recompute when caller/customizer supplies new component overrides
const finalComponents = useMemo(() => {
const mergedComponents = {
...(props.components ?? {}),
...(componentsOverride ?? {}),
};
const ParentMenuList = mergedComponents.MenuList ?? components.MenuList;

// Always set MenuList, conditionally render button inside
const CustomMenuList = ({
// eslint-disable-next-line react/prop-types
children, ...menuProps
}: MenuListProps<LabelValueOption<T>, boolean>) => (
<ParentMenuList {...menuProps}>
{children}
{showLoadMoreButtonRef.current && (
<div className="pt-4">
<LoadMoreButton onChange={() => onLoadMoreRef.current?.()} />
</div>
)}
</ParentMenuList>
);
CustomMenuList.displayName = "CustomMenuList";

return {
...mergedComponents,
MenuList: CustomMenuList,
};
}, [
props.components,
componentsOverride,
]);

const handleCreate = (inputValue: string) => {
const newOption = sanitizeOption(inputValue as T)
Expand Down Expand Up @@ -215,6 +244,7 @@ export function ControlSelect<T extends PropOptionValue>({
onChange={handleChange}
{...props}
{...selectProps}
components={finalComponents}
{...additionalProps}
/>
);
Expand Down
Loading
Loading