TextFieldState

class TextFieldState(initialValue: String = "", val maxLength: Int = 32)(source)

Owner-confined mutable value for one single-line text field.

The state accepts well-formed Unicode text excluding C0 controls, DEL, NEL (U+0085), line and paragraph separators (U+2028/U+2029), and the section-sign formatting marker. It owns its value and permits at most one live retained observer. Reads, writes, observation, and subscription release are confined to the execution owner that constructs the state.

Parameters

initialValue

initial well-formed single-line text.

Throws

when TextFieldState.maxLength is not positive or initialValue is unsupported or too long.

Constructors

Link copied to clipboard
constructor(initialValue: String = "", maxLength: Int = 32)

Properties

Link copied to clipboard

positive maximum UTF-16 length accepted by TextFieldState.value.

Link copied to clipboard

Current well-formed single-line Unicode value.

Functions

Link copied to clipboard
fun observe(callback: (String) -> Unit): AutoCloseable

Installs the sole retained observer used by a runtime text-field node.