Skip to content

How to use TextField's error composable #157

Answered by hrach
shalva97 asked this question in Q&A
Discussion options

You must be logged in to vote
TextField(
    value = server,
    modifier = Modifier.fillMaxWidth(),
    error = if (errors.value is Errors.BadServer) {
        @Composable { Text(text = "Can not connect to this server") }
    } else {
        null
    },
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shalva97
Comment options

Answer selected by shalva97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #156 on June 03, 2022 07:59.