Skip to content

Commit

Permalink
fix cursor in FormField not being updated properly
Browse files Browse the repository at this point in the history
  • Loading branch information
avan1235 committed Oct 4, 2023
1 parent 8ff3bb6 commit 6193d26
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusDirection
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.text.input.*
import dev.icerock.moko.resources.compose.stringResource
import ml.dev.kotlin.openotp.shared.OpenOtpResources

Expand All @@ -34,10 +31,14 @@ internal fun FormField(
) {
val focusManager = LocalFocusManager.current
var showPassword by remember { mutableStateOf(false) }
var textFieldValue by remember { mutableStateOf(TextFieldValue(text)) }

OutlinedTextField(
value = text,
onValueChange = onTextChange,
value = textFieldValue,
onValueChange = {
textFieldValue = it
onTextChange(it.text)
},
isError = isError,
modifier = Modifier.fillMaxWidth(),
label = { Text(text = name) },
Expand Down

0 comments on commit 6193d26

Please sign in to comment.