TextFieldHandle interface

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

interface TextFieldHandle

No documentation.

Properties

value

readonly value: string;

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

editing

readonly editing: 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: unknown;

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

Methods

onChange

onChange(event: {
    readonly currentTarget: {
        readonly value: string;
    };
}): void;

The input's onChange: the user changed the text.

onCompositionStart

onCompositionStart(): void;

The input's onCompositionStart: the text is kept but not written until the IME composition ends.

onCompositionEnd

onCompositionEnd(event: {
    readonly currentTarget: {
        readonly value: string;
    };
}): void;

The input's onCompositionEnd: the composed text is written.

reset

reset(): void;

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