Skip to content

Instantly share code, notes, and snippets.

@Skyyo
Created August 22, 2021 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Skyyo/5f46ab353debb8194f9df8577702255a to your computer and use it in GitHub Desktop.
Save Skyyo/5f46ab353debb8194f9df8577702255a to your computer and use it in GitHub Desktop.
@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