`@effect/ui-kit` (Effect-TS/ui): `portalBox` appends `width:0;height:0` after consumer inline style and cannot be overridden
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What version of Effect is running?
effect:4.1.6@effect/ui&@effect/ui-kit:Effect-TS/uimainat77391ee50ae3d3175d670facbf675e9a819ba6a6
What steps can reproduce the bug?
- Clone the minimal reproduction branch:
git clone -b repros/non-dom-host-uikit-bugs https://github.com/cliffordfajardo/ui.git effect-ui-repro cd effect-ui-repro pnpm install pnpm repro:test - Render a
Dialogwithopen: true(defaulttopLayer: true) and supply an explicit inlinestyleondialog.portal:
dialog.portal(
h.dialog.attr("style", "width:100%;height:100%")
)?.children(
dialog.popup(h.div).children(
dialog.title(h.h2).children("Modal"),
dialog.close(h.button).children("Tap Me")
)
)
- Inspect the emitted
styleattribute on<dialog>(see03-dialog-portalbox-overrides-consumer-style/repro.test.ts).
What is the expected behavior?
Consumer-provided sizing (width/height) on dialog.portal (or a host/stylesheet override) should be able to override the default portalBox reset rather than being unconditionally clobbered by trailing inline width:0;height:0;.
What do you see instead?
packages/ui-kit/src/internal/topLayer.ts:55 defines:
export const portalBox =
"position:fixed;inset:0;width:0;height:0;max-width:none;max-height:none;margin:0;padding:0;border:0;overflow:visible;background:transparent;color:inherit"
And Dialog (packages/ui-kit/src/Dialog.ts:1361-1364, also used by Drawer) — as well as PreviewCard (1247-1250) and NavigationMenu (911-915) — applies it via withStyle(node.elementAttrs.style, portalBox) (packages/ui-kit/src/internal/attributes.ts:10-13), which appends portalBox after the consumer's style:
style="width:100%;height:100%;position:fixed;inset:0;width:0;height:0;max-width:none;max-height:none;margin:0;padding:0;border:0;overflow:visible;background:transparent;color:inherit"
Because width:0;height:0 appears last in the inline style attribute, the winning declarations are width: 0 and height: 0:
AssertionError: expected '0' to equal '100%'
Additional information
Why this matters in practice:
- In browsers,
overflow:visibleallowsposition:fixeddescendants outside a0×0<dialog>box to remain clickable. - On non-browser layout engines rendering the
Htmlvocabulary (for example iOS UIKit + Taffy vians-effect-ui'sMasonHost),UIView.hitTest(_:with:)rejects touches outside a0×0ancestor view frame even whenclipsToBounds = falseallows its children to render visibly. - Because
portalBoxis appended last as an inlinestyle, neither stylesheets nor consumer.attr("style", "width:100%;height:100%")can override it, and passingtopLayer: falseis not an equivalent escape hatch because it changes modal/layering semantics.
Even prepending portalBox as defaults (so consumer inline styles win) or only emitting the reset declarations not already specified by the consumer would allow non-browser hosts and apps to size the portal container without breaking browser defaults.
- 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
- 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 Effect-TS/effect
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing componentsForse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11097 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`Forse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11096 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
check:failed streams:edit
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
iptv-org/iptv#60585 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Critical path skips a child span that ends exactly when the next one startsForse già presa @Piyush4801 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jaegertracing/jaeger-ui#4865 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno