hello :wave: noob compose question. I am trying t...
# compose
r
hello 👋 noob compose question. I am trying to build a login form, and am noticing that sometimes, my cursor does not seem to update to be at the end of my value. curious if anyone has any ideas why this may be happening. (attached video in 🧵)
✅ 2
CleanShot 2023-07-02 at 09.46.29.mp4
looks like I needed to use TextFieldValue instead of string 🙂
e
https://medium.com/androiddevelopers/effective-state-management-for-textfield-in-compose-d6e5b070fbe5 also make sure text state is updated synchronously (as it currently is in your example)
b
Been having this issue on recent versions of compose. Make sure your state variables are as close to the composable that's being rendered.
c
related video for your viewing pleasure

https://www.youtube.com/watch?v=oln9LO2aRVMâ–¾

z
Your state doesn’t need to be close to the field in a lexical, architectural, or data flow sense, but it does need to update synchronously, or at least in the same frame. So close chronologically I guess.