<slot /> used as a passthrough outlet inside an SFC template (e.g. DialogTrigger.vue's <Primitive as-child><slot /></Primitive>) resolves through Vue's renderSlot() helper, which always wraps the forwarded content in a Fragment vnode -- even when there's exactly one real child. Slot was cloning that inert Fragment wrapper instead of the real child, so attrs merged onto asChild-forwarded elements (data-slot, aria-*, the click handler) silently vanished. Found via manual Storybook verification: the Dialog trigger rendered but never opened the dialog on click. Unwrap single-child Fragments before merging/cloning, and add a regression test through a real SFC fixture (a raw h()-based test doesn't reproduce this, since it never goes through renderSlot()). |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| components.json | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||