Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Composable
fun CustomTextField(
modifier: Modifier,
inputWrapper: InputWrapper,
onValueChange: OnValueChange
) {
val fieldValue = remember {
mutableStateOf(TextFieldValue(inputWrapper.value, TextRange(inputWrapper.value.length)))
}
Column {
TextField(
modifier = modifier,
value = fieldValue.value,
onValueChange = {
fieldValue.value = it
onValueChange(it.text)
}
)
..
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment