Skip to content

Conversation

@chaance
Copy link
Member

@chaance chaance commented Sep 4, 2025

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.

@vercel
Copy link

vercel bot commented Sep 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
themes-playground Error Error Sep 4, 2025 10:36pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants