-
Notifications
You must be signed in to change notification settings - Fork 210
Open
Description
Short Description
The MorphingDialogTrigger component causes nested button hydration errors when wrapping custom buttons.
Problem Details
The MorphingDialogTrigger component currently renders as a motion.button wrapper, which causes invalid HTML structure and hydration errors when developers need to wrap custom button elements. This is particularly problematic in the example morphing-dialog-basic-1.tsx where a button is nested inside the trigger.
Current problematic structure:
<MorphingDialogTrigger className="..."> <button type="button"> {/* ... */} <PlusIcon /> </button> </MorphingDialogTrigger>
This results in:
- Invalid HTML - Buttons cannot be nested according to HTML spec
- React hydration errors
- Accessibility issues
- Event handling problems - Click events may conflict
Proposed Solutions
- Implement asChild Pattern (Recommended)
- Refactor Example to Remove Nested Button
Would you like me to prepare a pull request for this fix with asChild pattern?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels