You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you don't specify a concrete width for an AlertDialog, it attempts to display it as narrowly as possible, which often leaves a lot of unused horizontal space that could be used for a better result.
Reproducer:
@OptIn(ExperimentalMaterialApi::class)
fun main() = singleWindowApplication(
state = WindowState(width = 400.dp, height = 300.dp),
) {
MaterialTheme{
AlertDialog(
onDismissRequest = {},
title = { Text("This is the title") },
text = { Text("This is the text") },
confirmButton = { }
)
}
}
Affected platforms
Select one of the platforms below:
All
Versions
Compose Multiplatform version: 1.3.0
Expected behavior
The alert dialog should be wider, not breaking lines as long as there is more horizontal room.
Screenshots
The text was updated successfully, but these errors were encountered:
Another important issue caused by the same problem is that widthIn is ignored:
@OptIn(ExperimentalMaterialApi::class)
fun main() = singleWindowApplication(
state = WindowState(width = 500.dp, height = 400.dp),
) {
MaterialTheme{
AlertDialog(
modifier = Modifier.widthIn(max = 400.dp).padding(horizontal = 30.dp),
onDismissRequest = { },
title = { Text("This is the title") },
text = { Text("This is the text This is the text This is the text This is the text This is the text This is the text This is the text") },
confirmButton = {}
)
}
}
Describe the bug
If you don't specify a concrete width for an
AlertDialog
, it attempts to display it as narrowly as possible, which often leaves a lot of unused horizontal space that could be used for a better result.Reproducer:
Affected platforms
Select one of the platforms below:
Versions
Expected behavior
The alert dialog should be wider, not breaking lines as long as there is more horizontal room.
Screenshots
The text was updated successfully, but these errors were encountered: