Ensure loading button with `asChild` renders the correct element
Description
Using asChild with the button component in the loading state is currently broken. Because we wrap the child (assuming the child represents the inner contents of the button rather than the button element itself), Radix Slot is unable to resolve the slottable component since it is not a direct child of the slottable component. The result is that the button does not render a wrapping DOM element, and the loading spinner ends up positioned relative to nearest relative container.
This PR solves the problem by extracting the nested element's children, wrapping them, passing that into a clone of the element passed to the children prop.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| themes-playground | Sep 4, 2025 10:36pm |