State

termflow.tui.widgets.TextField.State
See theState companion object
final case class State(buffer: String, cursor: Int, placeholder: String)

Editable state for a single field.

Value parameters

buffer

Current text content.

cursor

Insertion-point index in [0, buffer.length].

placeholder

Hint text shown when buffer is empty AND the field is not focused. Empty disables the placeholder.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def cleared: State

Drop the buffer and reset the cursor while preserving the placeholder.

Drop the buffer and reset the cursor while preserving the placeholder.

Convenience for prompt-style "submit and clear" callers: when the onSubmit message fires, replace the field state with field.cleared to reset for the next entry. Form-style "submit and keep" callers leave the state alone.

Attributes

def isEmpty: Boolean

true when the buffer has no characters.

true when the buffer has no characters.

Attributes

def length: Int

Number of characters in the buffer (not counting the placeholder).

Number of characters in the buffer (not counting the placeholder).

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product