Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
4 changes: 2 additions & 2 deletions packages/connect-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"vite-plugin-dts": "^4.3.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
}
83 changes: 47 additions & 36 deletions packages/connect-react/src/components/ControlApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,44 +146,55 @@ export function ControlApp({ app }: ControlAppProps) {
app,
...formFieldCtx,
})}>
{isLoadingAccounts ?
`Loading ${app.name} accounts...`
: accounts.length ?
<Select
instanceId={id}
value={selectValue}
options={selectOptions}
{...selectProps}
required={true}
placeholder={`Select ${app.name} account...`}
isLoading={isLoadingAccounts}
isClearable={true}
isSearchable={true}
getOptionLabel={(a) => a.name ?? ""}
getOptionValue={(a) => a.id}
onChange={(a) => {
if (a) {
if (a.id === "_new") {
// start connect account and then select it, etc.
// TODO unset / put in loading state
startConnectAccount();
{isLoadingAccounts
? `Loading ${app.name} accounts...`
: accounts.length
? (
<Select
instanceId={id}
value={selectValue}
options={selectOptions}
{...selectProps}
// These must come AFTER selectProps spread to avoid being overridden
classNamePrefix="react-select"
required={true}
placeholder={`Select ${app.name} account...`}
isLoading={isLoadingAccounts}
isClearable={true}
isSearchable={true}
getOptionLabel={(a) => a.name ?? ""}
getOptionValue={(a) => a.id}
menuPortalTarget={
typeof document !== "undefined"
? document.body
: null
}
menuPosition="fixed"
onChange={(a) => {
if (a) {
if (a.id === "_new") {
// start connect account and then select it, etc.
// TODO unset / put in loading state
startConnectAccount();
} else {
onChange({
authProvisionId: a.id,
});
}
} else {
onChange({
authProvisionId: a.id,
});
onChange(undefined);
}
} else {
onChange(undefined);
}
}}
/>
:
<button type="button" {...getProps("connectButton", baseStylesConnectButton, {
app,
...formFieldCtx,
})} onClick={() => startConnectAccount()}>
Connect {app.name}
</button>
}}
/>
)
: (
<button type="button" {...getProps("connectButton", baseStylesConnectButton, {
app,
...formFieldCtx,
})} onClick={() => startConnectAccount()}>
Connect {app.name}
</button>
)
}
</div>
);
Expand Down
10 changes: 9 additions & 1 deletion packages/connect-react/src/components/ControlSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,16 @@ export function ControlSelect<T extends PropOptionValue>({
onChange={handleChange}
{...props}
{...selectProps}
components={finalComponents}
{...additionalProps}
// These must come AFTER spreads to avoid being overridden
classNamePrefix="react-select"
menuPortalTarget={
typeof document !== "undefined"
? document.body
: null
}
menuPosition="fixed"
components={finalComponents}
/>
);
}
12 changes: 12 additions & 0 deletions packages/connect-react/src/components/SelectApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ export function SelectApp({
}}
onMenuScrollToBottom={handleMenuScrollToBottom}
isLoading={isLoading}
menuPortalTarget={
typeof document !== "undefined"
? document.body
: null
}
menuPosition="fixed"
styles={{
menuPortal: (base) => ({
...base,
zIndex: 99999,
}),
}}
/>
);
}
12 changes: 12 additions & 0 deletions packages/connect-react/src/components/SelectComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ export function SelectComponent({
onMenuScrollToBottom={handleMenuScrollToBottom}
isLoading={isLoading}
components={customComponents}
menuPortalTarget={
typeof document !== "undefined"
? document.body
: null
}
menuPosition="fixed"
styles={{
menuPortal: (base) => ({
...base,
zIndex: 99999,
}),
}}
/>
);
}
37 changes: 13 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading