We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Astro v5.2.5 Node v22.14.0 System Windows (x64) Package Manager pnpm Output static Adapter none Integrations @astrojs/mdx @astrojs/react
No response
Using Astro components with slots results in lists items being generated outside of the slot
Menu.astro:
<menu><slot /></menu>
Nav.astro:
--- import Menu from "./Menu.astro"; --- <nav> <menu> <li> <Menu> <li>test</li> </Menu> </li> </menu> </nav>
HTML output:
<body> <nav> <menu> <li><menu></menu></li> <li>test</li> </menu> </nav> </body>
List items go inside the slot correctly
https://stackblitz.com/edit/github-jtgsx6ty
The text was updated successfully, but these errors were encountered:
@mthierman I can confirm this.... good find!!
if the parents are eg <nav><div><div> then the nested menu is fine
<nav><div><div>
it's also the same problem if we use <ul> instead of <menu> in the parent
<ul>
<menu>
if you change Menu.astro to the following, you can see that the fallback content is not getting replaced properly as it still shows up in the output
Menu.astro
<menu> <slot><li>fallback content<li></slot> </menu>
Sorry, something went wrong.
No branches or pull requests
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Using Astro components with slots results in lists items being generated outside of the slot
Menu.astro:
Nav.astro:
HTML output:
What's the expected result?
List items go inside the slot correctly
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-jtgsx6ty
Participation
The text was updated successfully, but these errors were encountered: