Hello, I have a question about alerdialog, this co...
# compose
m
Hello, I have a question about alerdialog, this component only can have a title and a text? according the API one alertdialog have these parameters
Copy code
title: (@Composable () -> Unit)? = null,
text: @Composable (() -> Unit)? = null,
 both are composable but the name indicate something specific (text). I have tried to create a OutlinedTextField in text parameter with a strange result, it would not be better to create a content parameter?
and no, the
text
composable slot allows you to set anything inside it
m
yes I know is a compose function, but I have a strange result with a OutlinedTextField, and the name "text" maybe would be better a "content" as a button
a
what youmean by "strange result".... if you post some code, and screenshots we may can help you
m
yes let me share a video
a
🙌 1
👀 1
m
Copy code
@Composable
fun AddAlertDialog() {
    val textState = remember { mutableStateOf(TextFieldValue()) }
    AlertDialog(
        onDismissRequest = { },
        text = {
            OutlinedTextField(
                modifier = Modifier.wrapContentWidth(),
                value = textState.value,
                onValueChange = { textState.value = it },
                label = { Text("Nueva categoría") })
        },
        dismissButton = {
            TextButton(
                onClick = {}) {
                Text(stringResource(id = android.R.string.cancel).uppercase(Locale.getDefault()))
            }
        },
        confirmButton = {
            TextButton(
                onClick = {}) {
                Text(stringResource(id = android.R.string.ok))

            }
        }
    )
}
I am using rc2
a
uhmmm, yes weird. maybe use a Box, and give it a fixed height bigger than the outlined text box itself
m
yes, this way works but i wouldn't like to have a fixed height, wrapContentHeight should work 😞
a
don't forget to mention if you found a solutioon
m
ok I will do so, thx
@alorma I found the problem
a
🦜
m
the problem is my custom typografy
I am using font
Copy code
Sarabum
it must be a little bigger than the default
im going to open a issue because i think should adapt to all kinds of fonts
e
It's also possible to use
Dialog
instead of
AlertDialog
if you want to have a custom layout