TextFieldHandle interface

Module @runic-artifex/angular in @runic-artifex/angular 0.23.0

interface TextFieldHandle

A text input bound to one View member.

Properties

value

readonly value: Signal<string>;

What the input shows: the draft while one exists, otherwise the member's value in the View's state.

editing

readonly editing: Signal<boolean>;

True while a draft exists, from the first input until the last write settled and the state caught up, and after a failed write. Keep the input enabled while it is true, rather than disabling it on the View's busy state, which the field's own write causes.

error

readonly error: Signal<unknown>;

Why the latest write failed, until the next input or reset().

Methods

input

input(event: Event | string): void;

The user changed the text: pass the input event, or the new text.

compositionStart

compositionStart(): void;

An IME composition started: the text is kept but not written until it ends. Bind it to compositionstart.

compositionEnd

compositionEnd(event: Event | string): void;

The IME composition ended: pass the compositionend event, or the text, which is then written.

reset

reset(): void;

Drops the draft and the error and shows the View's value. Writes in flight still complete.