Skip to content

Commit

Permalink
Develop release 0.1.1 (#184)
Browse files Browse the repository at this point in the history
* ANDROAPP-5881-Input-with-virtual-keyboard-not-working-correctly (#178)

* fix: [ANDROAPP-5881] Add textfieldComposition to textfield value to avoid infinite calls to onValueChanged

* fix: [ANDROAPP-5881] Ktlint fix

* fix: [ANDROAPP-5881] test fix for input age

* fix: [ANDROAPP-5895] Correct misalignment when entering text in input shell (#181)
  • Loading branch information
xavimolloy authored Jan 30, 2024
1 parent 498f2c2 commit 8865bdf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ fun BasicTextField(
var textFieldSelection by remember {
mutableStateOf(TextRange(if (inputText.isEmpty()) 0 else inputText.length))
}
var textFieldComposition by remember {
mutableStateOf(if (inputText.isEmpty()) null else TextRange(0, if (inputText.isEmpty()) 0 else inputText.length))
}

CompositionLocalProvider(LocalTextSelectionColors provides customTextSelectionColors) {
BasicTextField(
Expand All @@ -145,9 +148,11 @@ fun BasicTextField(
value = TextFieldValue(
text = inputText,
selection = textFieldSelection,
composition = textFieldComposition,
),
onValueChange = {
textFieldSelection = it.selection
textFieldComposition = it.composition
onInputChanged.invoke(it.text)
},
enabled = enabled,
Expand Down

0 comments on commit 8865bdf

Please sign in to comment.