Zoltan Demant
04/29/2025, 9:00 AMStylianos Gakis
04/29/2025, 1:44 PMZoltan Demant
04/29/2025, 1:52 PMStylianos Gakis
04/29/2025, 2:25 PMZoltan Demant
04/29/2025, 2:41 PMHalil Ozercan
04/29/2025, 6:07 PMinputMethodManager.restartInput
call. This is mostly about the content of the text, if you end up only changing the selection, usually IME only requires inputMethodManager.updateSelection()
, then it doesn't reset.
As a user, you wouldn't even notice IME reset events most of the time. But long pressing on backpress is one of those cases where you would definitely feel it.Halil Ozercan
04/29/2025, 6:09 PMTextFieldState
? There are some exceptions to this rule that I just described so if an exception makes sense, we can fix it.Halil Ozercan
04/29/2025, 6:09 PMHalil Ozercan
04/29/2025, 6:13 PMZoltan Demant
04/30/2025, 4:04 AMTextFieldValue
variant. Just switching to the string version solves a bunch of text selection issues that Ive been having and Ill try the deletion case later today (but almost certain that it will work too).Zoltan Demant
04/30/2025, 4:06 AMZoltan Demant
04/30/2025, 4:20 AMHalil Ozercan
04/30/2025, 12:24 PMZoltan Demant
04/30/2025, 12:52 PMZoltan Demant
05/02/2025, 1:02 PMTextField
and OutlineTextField
with TextFieldValue
. Im doing this because I find the cursor positioning with the string overload to not match my preferences. But thats the only reason, it seems that for everything else - the string overload "just works".
I think the fact that Im using TextFieldValue
while also kind of trying to use strings, is whats causing issues for me. Ive tried a multitude of different ways to update the state; the simplest being just doing textFieldValue = textFieldValue.copy(text = newText). I always store the "actual data" as string, for sake of example this could be in a ViewModel with say MutableStateFlow<State> where State.text exists and is updated whenever the input field changes.Zoltan Demant
05/02/2025, 2:08 PMZoltan Demant
05/02/2025, 2:09 PMZoltan Demant
05/02/2025, 2:10 PMHalil Ozercan
05/02/2025, 2:23 PMZoltan Demant
05/02/2025, 2:26 PMZoltan Demant
05/07/2025, 3:29 AM