Nacho Ruiz Martin
12/24/2023, 1:10 PMBasicTextField2TextFieldStateeditNacho Ruiz Martin
12/24/2023, 1:11 PMFranSoto
12/24/2023, 2:48 PMNacho Ruiz Martin
12/24/2023, 2:55 PMFranSoto
12/24/2023, 4:42 PMNacho Ruiz Martin
12/24/2023, 5:01 PMFranSoto
12/24/2023, 5:01 PMHalil Ozercan
12/25/2023, 1:05 AMbecause you wouldn't be able to edit the text programmatically in the VM layerCan you give some examples to this? What is blocking you from implementing the filtering functionality in the UI layer, or call ViewModel functions from
inputTransformationHalil Ozercan
12/25/2023, 1:06 AMBasicTextField2efemoney
12/25/2023, 10:48 AMKarthick
12/25/2023, 3:48 PMStateFlowstateFlow.collectAsState()Nacho Ruiz Martin
12/25/2023, 5:05 PMTextFieldStateTextFieldStateNacho Ruiz Martin
12/25/2023, 5:14 PMAlbert Chang
12/26/2023, 2:28 PMString(String) -> UnitNacho Ruiz Martin
12/26/2023, 2:29 PMAlbert Chang
12/26/2023, 2:32 PMNacho Ruiz Martin
12/26/2023, 2:35 PMHowever, the text field won’t update the state with your programmatic changes while the field is in focus, it respects only the input coming from typing events
Albert Chang
12/26/2023, 3:07 PMAlbert Chang
12/26/2023, 3:12 PMKarthick
12/26/2023, 3:36 PMTextFieldStateNacho Ruiz Martin
12/26/2023, 3:43 PMDon't you need to place the cursor at the end when you prepend the text?
Ah, you're right. Since this wasn't a real case but a theoretical one I missed the fact that you have to store TextFieldState on BTF1 for the same behaviour. So expect/actual feels like the way to go in the current case too.
You can see the overloads just receiving just text and inside handle with TextFieldState
Yes, I know the existence of this overload. But as it was already stated, this isn't usable because the UI won't update until the text field loses focus. Anyway, @Halil Ozercan, in case you want a usecase that is not covered by the BTF2 API (it wasn't exactly covered by the BTF1 either).