`@effect/ui-kit` (Effect-TS/ui): an open `Dialog` or `Drawer` reads as hidden to Playwright, because its portal box is 0×0

Aperta
#11,084 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@effect-bot ci sta già lavorando.

Dal 29/11/2026.

  • #651 di @effect-bot — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
playwright, typescript
Ambito
frontend, testing

Direzione di ricerca

Start by reading packages/ui-kit/src/internal/topLayer.ts, where the issue identifies the portal box styling, and check the linked open pull request #651 for work already underway. Reproduce the visibility failure with a kit Dialog or Drawer in Playwright, then verify that the dialog role becomes visible while its contents remain usable. The issue proposes either giving the open portal a real box or documenting the test workaround.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

An open Dialog or Drawer from @effect/ui-kit reads as hidden to Playwright. await page.getByRole("dialog").waitFor({ state: "visible" }) never resolves, and expect(page.getByRole("dialog")).toBeVisible() fails, while the sheet is on screen and the accessibility tree names the dialog.

Why

The portal is a <dialog popover> styled with portalBox (packages/ui-kit/src/internal/topLayer.ts):

export const portalBox = "position:fixed;inset:0;width:0;height:0;" + boxReset

The scrim and the popup overflow that 0×0 box, so people see them. Playwright, though, treats an element with an empty bounding box as not visible, and the dialog role sits on that box.

Repro

  1. Render any kit Dialog with props: { open: true } in a page served to Playwright (Chromium).
  2. await page.getByRole("dialog").waitFor({ state: "visible", timeout: 2000 }) times out.
  3. await page.getByRole("dialog").getByRole("heading").waitFor({ state: "visible" }) resolves.

Seen at Effect UI 4ac356c with Playwright's bundled Chromium.

Ask

Either give the portal a real box while it is open (for example width:100%; height:100% with pointer-events:none, leaving the popup to take events), or document that tests should wait for something inside the dialog. People hit this the first time they write a browser test against a kit dialog.

Lingua principale
TypeScript
Stelle
16.7k
Fork
808
Merge medio
21h 22m
PR unite (30g)
486

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Effect-TS/effect

Tutte le issue di Effect-TS/effect

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.