Closed lucas-barake closed 1 day ago
-const Sheet = SheetPrimitive.Root
+const Sheet = ({
+ ...props
+}: React.ComponentProps<typeof SheetPrimitive.Root>) => (
+ <SheetPrimitive.Root {...props} />
+)
And in your example you messed up sheet content with dialog content https://github.com/lucas-patron/shadcnui-sheet-dialog/blob/4c54e0c81dcdacea3e96f2af149caae06eb29351/src/pages/index.tsx#LL38C8-L38C8
And in your example you messed up sheet content with dialog content https://github.com/lucas-patron/shadcnui-sheet-dialog/blob/4c54e0c81dcdacea3e96f2af149caae06eb29351/src/pages/index.tsx#LL38C8-L38C8
Whoops, silly mistake. Didn't notice the use of dialog content. Oddly enough, while it fixed it in the minimal example, it didn't in my own project.
-const Sheet = SheetPrimitive.Root +const Sheet = ({ + ...props +}: React.ComponentProps<typeof SheetPrimitive.Root>) => ( + <SheetPrimitive.Root {...props} /> +)
Anyway, this fixed it for me - It's worth noting that this bit isn't included in the official code.
Thanks!
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.
Description
While attempting to use both, the
dialog
andsheet
components within the same view, thesheet
component behaves like adialog
instead of opening on the designated side.To Reproduce
Render a
dialog
and asheet
component within the same page, as evidenced in this example or here.The components don't necessarily have to be side-by-side. As long as they are rendered in the same view, the issue arises.
Expected Behavior:
I expected the
dialog
component to open as a modal in the center of the view, while thesheet
component should open on the designated side (right, left, top, or bottom).Actual Behavior:
Instead, the
sheet
component behaves like adialog
and opens in the middle of the view, overlapping thedialog
component (or vice-versa, thedialog
behaves like asheet
).This behavior is inconsistent with the intended functionality of the components.
I checked the documentation and examples, but I did not come across any explicit mention of this particular limitation. Pardon me if I overlooked this information. Thanks in advance!