Skip to content

Modifier used in content of Dialog #379

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

Open
ede-wolf-gls opened this issue Nov 21, 2024 · 0 comments
Open

Modifier used in content of Dialog #379

ede-wolf-gls opened this issue Nov 21, 2024 · 0 comments

Comments

@ede-wolf-gls
Copy link

I had something similar ti the following code:

@Composable
fun SomeDialog(onDismiss: () -> Unit, modifier: Modifier = Modifier) {
    Dialog(onDismissRequest = onDismiss) {
        Box(modifier) { /* ... */ }
    }
}

I was wondering, why the ModifierNotUsedAtRoot didn't complain. I see the code behind it, but does it really make sense to allow the modifier to be propagated to a child of a dialog? Because it might lead to a bad understanding, that one would expect the dialog to be modified, but it's not (of course, but just its content).
Not sure, if it should be done with this rule or another one.

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

No branches or pull requests

1 participant