fix: add getPopupContainer to Select components in fallback modal to fix z-index issue (#23516)

The model dropdown menus in the Add Fallbacks modal were rendering behind
the modal overlay because Ant Design portals Select dropdowns to document.body
by default. By setting getPopupContainer to attach the dropdown to its parent
element, the dropdown inherits the modal's stacking context and renders above
the modal.

Fixes #17895
This commit is contained in:
Ethan T. 2026-03-14 12:58:58 +08:00 • committed by GitHub
parent a0a951b34f
commit 7bb2d78394
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,6 +78,7 @@ export function FallbackGroupConfig({
value={group.primaryModel}
onChange={handlePrimaryChange}
showSearch
getPopupContainer={(trigger) => trigger.parentElement || document.body}
filterOption={(input, option) =>
(option?.label ?? "").toLowerCase().includes(input.toLowerCase())
}
@ -125,6 +126,7 @@ export function FallbackGroupConfig({
value={group.fallbackModels}
onChange={handleFallbackSelect}
disabled={!group.primaryModel}
getPopupContainer={(trigger) => trigger.parentElement || document.body}
options={availableFallbackOptions.map((m) => ({
label: m,
value: m,