https://kotlinlang.org logo
#compose
Title
# compose
a

AmrJyniat

10/28/2021, 7:39 AM
When I set 
isError = true
 to the TextField the border's color not becomes only Red but I see it's combination of PrimaryColor and Red, any tips about the issue?
f

Felix Schütz

10/28/2021, 7:47 AM
This does not happen for me. Can you show your code? What version of androidx.compose.material are you using?
a

AmrJyniat

10/28/2021, 7:49 AM
Copy code
OutlinedTextField(
    value = text,
    onValueChange = { newText -> onTextChange(newText) },
    modifier =  Modifier
    .fillMaxWidth()
    .border(
        BorderStroke(
            width = 1.dp,
            color = Purple500
        ),
        shape = RoundedCornerShape(4.dp)
    ),
    placeholder = { Text(text = hint, style = textHintStyle) },
    isError = errorResStringId != null,
    colors = TextFieldDefaults.outlinedTextFieldColors(
        errorBorderColor = Color.Red,
        focusedBorderColor = MaterialTheme.colors.secondary,
        unfocusedBorderColor = MaterialTheme.colors.secondary,
    )
)
Compose material version 1.0.3
f

Felix Schütz

10/28/2021, 8:04 AM
You apply a border to the text field, so I think this is the additional color around the input.
1
a

AmrJyniat

10/28/2021, 8:29 AM
You're right! Thanks