TextFieldBuffer
A buffer object in Jetpack Compose for programmatically modifying text. It provides operations such as insert, replace and delete, and is used through the edit function.
Timeline (last 90 days)
Because text is a read-only property, programmatically modifying TextFieldState must be done through the TextFieldState.edit function, which provides a TextFieldBuffer exposing operations such as insert, replace, and delete.
The new API introduces InputTransformation, which intercepts user input before it reaches TextFieldState and provides the same API as TextFieldBuffer, including change list capability.
The new OutputTransformation is based on TextFieldBuffer; developers only need to call the insert function at the specified index, and the system automatically computes the bidirectional offset mapping, whereas the old VisualTransformation API required the bidirectional mapping to be implemented manually.
All Facts (3)
Because text is a read-only property, programmatically modifying TextFieldState must be done through the TextFieldState.edit function, which provides a TextFieldBuffer exposing operations such as insert, replace, and delete.
50%UnverifiedThe new API introduces InputTransformation, which intercepts user input before it reaches TextFieldState and provides the same API as TextFieldBuffer, including change list capability.
50%UnverifiedThe new OutputTransformation is based on TextFieldBuffer; developers only need to call the insert function at the specified index, and the system automatically computes the bidirectional offset mapping, whereas the old VisualTransformation API required the bidirectional mapping to be implemented manually.
50%