Does anybody know if there is any issue with *`and...
# compose
c
Does anybody know if there is any issue with
androidx.compose.material3
v1.0.0-alpha02
and setting (according material 3 specification) right color on TextButton
Copy code
TextButton(
    onClick = onConfirm,
    enabled = onConfirmEnable,
    colors = ButtonDefaults.textButtonColors(
        contentColor = MaterialTheme.colorScheme.primary,
        disabledContentColor = Color.Red,
        containerColor = Color.Transparent,
        disabledContainerColor = Color.Transparent,
    )
Doing by this che color always have primary color even when it’s disable…..I know those “transparent” look ugly, they were just for test it quicker! 😄
My bad..... The inner color set for the text was rightly taking over the setting made by the outer! ,😅
m
Hey, does the below code fix your problem?
Copy code
TextButton(
        onClick = onConfirm,
        enabled = onConfirmEnable,
        colors = ButtonDefaults.textButtonColors(
            contentColor = MaterialTheme.colorScheme.primary,
            disabledContentColor = Color.Red,
            backgroundColor = Color.Transparent,
        ),
    ){
        // Add content here
    }