'I have a problem with jetpack compose textfield and the keyboard autocomplete

While writing in a textfield in compose, when i write a sequence that look like "something.something". Where "something" isn't a white space, the cursor behave strangely.

Here i enter a random word:

I add the "."

Here when i enter the new caracter like you can see bellow the word the the first caracter seems to be ignore by the autocorrect

When i enter the second caracter it is display before the last one

It continue continue like this

For the code :

val (title, setTitle) = remember { mutableStateOf ("")}
TextField( 
Modifier = Modifier.padding(5.dp),
MaxLines = 1, 
label = {Text(text = "Title")},
value = title, 
onValueChange = setTitle, 
)

And my compose version is '1.0.1'

i also try some compose samples like "jetchat" but they does the same thing.



Solution 1:[1]

You should use rememberSaveable rather than remember

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Victor Peghaire