Skip to content
New issue

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

[Dialog] Fix nesting different kinds of dialogs #1166

Closed
wants to merge 1 commit into from

Conversation

mj12albert
Copy link
Member

Fixes #1165

@mj12albert mj12albert added bug 🐛 Something doesn't work component: dialog This is the name of the generic UI component, not the React module! labels Dec 18, 2024
@mj12albert mj12albert changed the title Fix nesting different kinds of dialogs [Dialog] Fix nesting different kinds of dialogs Dec 18, 2024
@mj12albert mj12albert marked this pull request as ready for review December 18, 2024 15:07
@mui-bot
Copy link

mui-bot commented Dec 18, 2024

Netlify deploy preview

https://deploy-preview-1166--base-ui.netlify.app/

Generated by 🚫 dangerJS against 7e6c98e

@mj12albert mj12albert requested a review from mnajdova December 18, 2024 15:09

const dialogRoot = useDialogRoot({
open,
defaultOpen,
onOpenChange,
modal: true,
dismissible: false,
onNestedDialogClose: parentDialogRootContext?.onNestedDialogClose,
onNestedDialogOpen: parentDialogRootContext?.onNestedDialogOpen,
onNestedDialogClose: parentContext?.onNestedDialogClose,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be cleaner to have a shared context for the element that are shared across the various dialog types?
Or are we confident that we won't have another type of dialog (not sure if a drawer falls in the category) that we will have to remember to add here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I started working on this coincidently, let me open a PR. @mj12albert please assign an issue to you if you plan to work on it to avoid duplicated work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative PR: #1167

@colmtuite colmtuite requested a review from vladmoroz December 18, 2024 15:23
@mj12albert mj12albert closed this Dec 18, 2024
@mj12albert mj12albert deleted the fix/nested-dialogs branch December 19, 2024 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: dialog This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[dialog] Nested alert dialogs aren't recognised as nested dialogs and vice versa
4 participants