Skip to content

Commit 4baf25e

Browse files
z-index fixes for dropdowns
1 parent 9f6627a commit 4baf25e

File tree

6 files changed

+30
-27
lines changed

6 files changed

+30
-27
lines changed

packages/connect-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"vite-plugin-dts": "^4.3.0"
4545
},
4646
"peerDependencies": {
47-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
48-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
47+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
48+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
4949
}
5050
}

packages/connect-react/src/components/ControlApp.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,17 @@ export function ControlApp({ app }: ControlAppProps) {
154154
value={selectValue}
155155
options={selectOptions}
156156
{...selectProps}
157+
// These must come AFTER selectProps spread to avoid being overridden
158+
classNamePrefix="react-select"
157159
required={true}
158160
placeholder={`Select ${app.name} account...`}
159161
isLoading={isLoadingAccounts}
160162
isClearable={true}
161163
isSearchable={true}
162164
getOptionLabel={(a) => a.name ?? ""}
163165
getOptionValue={(a) => a.id}
166+
menuPortalTarget={typeof document !== "undefined" ? document.body : null}
167+
menuPosition="fixed"
164168
onChange={(a) => {
165169
if (a) {
166170
if (a.id === "_new") {

packages/connect-react/src/components/ControlSelect.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,12 @@ export function ControlSelect<T extends PropOptionValue>({
256256
onChange={handleChange}
257257
{...props}
258258
{...selectProps}
259-
components={finalComponents}
260259
{...additionalProps}
260+
// These must come AFTER spreads to avoid being overridden
261+
classNamePrefix="react-select"
262+
menuPortalTarget={typeof document !== "undefined" ? document.body : null}
263+
menuPosition="fixed"
264+
components={finalComponents}
261265
/>
262266
);
263267
}

packages/connect-react/src/components/SelectApp.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ export function SelectApp({
172172
}}
173173
onMenuScrollToBottom={handleMenuScrollToBottom}
174174
isLoading={isLoading}
175+
menuPortalTarget={typeof document !== "undefined" ? document.body : null}
176+
menuPosition="fixed"
177+
styles={{ menuPortal: (base) => ({ ...base, zIndex: 99999 }) }}
175178
/>
176179
);
177180
}

packages/connect-react/src/components/SelectComponent.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ export function SelectComponent({
9898
onMenuScrollToBottom={handleMenuScrollToBottom}
9999
isLoading={isLoading}
100100
components={customComponents}
101+
menuPortalTarget={typeof document !== "undefined" ? document.body : null}
102+
menuPosition="fixed"
103+
styles={{ menuPortal: (base) => ({ ...base, zIndex: 99999 }) }}
101104
/>
102105
);
103106
}

pnpm-lock.yaml

Lines changed: 13 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)