TextField in Jetpack Compose: past, present and future
summary
Jetpack Compose now ships an alpha rewrite that replaces the old value/onValueChange loop with BasicTextField2 and a rememberTextFieldState model, breaking the fragile sync between the UI, keyboard and coordinator that previously kept three copies of state. New primitives include TextFieldBuffer (edit/insert/delete/select), input and output transformations, lineLimits, and textFieldState.asTextFlow for coroutine-friendly validation. BasicSecureTextField exists for masked input; output transformation is implemented but not yet merged to main.
AI-written summary · about
chapters (16)
- 0:00Introduction to TextField in Compose
- 1:04Current TextField API recap
- 9:55Problems with current API
- 10:57Introducing TextField V2
- 11:39Basic TextField State setup
- 13:24Styling TextField V2
- 14:48Line limits configuration
- 15:34Observing TextField state
- 19:31Programmatically editing text
- 22:01Visual transformation overview
- 23:47Input transformation explained
- 26:12Output transformation explained
- 27:35Secure text field handling
- 30:28Future of TextField API
- 31:54Resources and next steps
- 32:15Q&A and closing
