Multi-tenant: the assign-tenant modal opens behind a nested drawer and takes its focus
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 40/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nextjs, react, typescript
- Ambito
- frontend
Direzione di ricerca
Start in the multi-tenant plugin's AssignTenantFieldModal, where zIndex is computed from drawerZBase and useDrawerDepth imported from @payloadcms/ui/elements/Drawer. Compare that with how the admin's drawers get the same values from the main @payloadcms/ui entry, which the issue says doesn't export them. Reproduce with the linked repo: open a media drawer inside Acme's drawer and check whether the modal sits above it. Done means the modal shows above nested drawers, and the fix needs a decision on how the plugin should share the drawer depth context.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the Bug
When the user can access more than one tenant, none is selected, and a tenant-scoped document is created in a drawer inside another drawer, the assign-tenant modal opens underneath that drawer. It's hidden, but its focus trap still wins, so the drawer's fields can't be focused.
AssignTenantFieldModal sets zIndex: drawerZBase + useDrawerDepth(), importing both from @payloadcms/ui/elements/Drawer. That's a separate copy of the drawer module from the prebundled @payloadcms/ui entry the admin's drawers use, so its depth context is never provided and the modal is always at 101. A nested drawer is at 102. One drawer deep they tie at 101 and the modal shows, which is why it only breaks when nested. The main entry doesn't export useDrawerDepth or drawerZBase, so the plugin can't simply import them from there instead.
We've worked around this by forcing .assign-tenant-field-modal to z-index 200 with !important.
Related:
- #14727 also leaves an invisible modal blocking the UI, but from missing visibility classes, not z-index
- #10109 fixed the same kind of problem for the unpublish modal in drawers.
- #17006 rewrote this modal for 4.0 so this is probably 3.x only
Link to the code that reproduces this issue
https://github.com/scottybrown/payload-repros/tree/repro/tenant-modal-behind-nested-drawer
Reproduction Steps
Copy .env.example to .env and point DATABASE_URL at an empty Postgres database.
The repro adds the multi-tenant plugin for media, a tenants collection with an image upload, and a pages collection with a featuredTenant relationship.
pnpm dev, open/admin, and create the first user with passwordlongenough1.- Create two tenants,
AcmeandBeta. - Create a page with Acme as its Featured Tenant.
- On the Pages list, clear "Filter by Tenant" in the sidebar.
- Open the page, then open Acme with the edit icon in Featured Tenant.
- In Acme's drawer, choose Create New under Image.
- Click Alt and type.
Expected: the assign-tenant modal shows above the media drawer, as it does one drawer deep (Create New under Image on Acme's own edit screen) ✅
Actual: the modal opens behind the media drawer (z-index 101 against 102). Alt can't be focused or typed in. Alt is required, so the new media can't be saved.
https://github.com/user-attachments/assets/a17dd531-e462-497b-b616-2d1cdf51bef3
Which area(s) are affected?
plugin: multi-tenant
Environment Info
Binaries:
Node: 24.22.1
npm: 11.19.1
Yarn: N/A
pnpm: 10.14.0
Relevant Packages:
payload: 3.93.0
next: 16.4.3
@payloadcms/db-postgres: 3.93.0
@payloadcms/drizzle: 3.93.0
@payloadcms/graphql: 3.93.0
@payloadcms/next/utilities: 3.93.0
@payloadcms/plugin-multi-tenant: 3.93.0
@payloadcms/richtext-lexical: 3.93.0
@payloadcms/translations: 3.93.0
@payloadcms/ui/shared: 3.93.0
react: 19.2.6
react-dom: 19.2.6
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 27.0.0: Tue Aug 11 21:06:24 PDT 2026; root:xnu-13432.1.9~1/RELEASE_ARM64_T6030
Available memory (MB): 36864
Available CPU cores: 11
- Lingua principale
- TypeScript
- Stelle
- 45.8k
- Fork
- 4.4k
- Merge medio
- 2g 16h
- PR unite (30g)
- 251
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di payloadcms/payload
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysForse già presa @pcbeingused333 l’ha presa 1 giorno fa. ApertaBug db: d1-sqlite Payload OSS
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
payloadcms/payload#19766 ·
I maintainer di solito rispondono entro 1 giorno
-
Document bar (.doc-controls__content) overflows a 375 px viewport, clips "Created" and fails axe scrollable-region-focusableForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea: ui Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
payloadcms/payload#19690 ·
I maintainer di solito rispondono entro 1 giorno
-
[v4] Blocks thumbnails croped 3:2Forse già presa @samiarif02 l’ha presa 2 giorni fa. Apertaarea: ui Bug Payload OSS status: needs-triage v3
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
payloadcms/payload#19609 ·
I maintainer di solito rispondono entro 1 giorno
-
Scheduled publish jobs are not deleted when their document is deleted (string id in the job, raw id in the cleanup)Forse già presa @volodymyrshk l’ha presa 10 giorni fa. Apertaarea: core Bug db: sqlite
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
payloadcms/payload#19448 ·
I maintainer di solito rispondono entro 1 giorno
-
plugin-multi-tenant: `isGlobal` collections redirect tenant-scoped users to `/admin` since 3.93.0 (GlobalViewRedirect prop-name mismatch)Forse già presa @JarrodMFlesch l’ha presa 11 giorni fa. ApertaBug plugin: multi-tenant
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
payloadcms/payload#19420 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di payloadcms/payload
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
milind-soni/OpenMausBot#6730 ·
I maintainer di solito rispondono entro 1 giorno
-
`@angular/[email protected]` depends on vulnerable Vite 7.3.7 - GHSA-p4f5-76q4-ffq7 (Critical RCE)Apertaarea: @angular/build
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
angular/angular-cli#34764 ·
I maintainer di solito rispondono entro 1 giorno
-
status/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
google-gemini/gemini-cli#30384 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
area:image documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno