combobox/keys#

Interfaces#

ComboboxState#

Defined in: editor/src/combobox/keys.ts:9

Whether the list is open, and which option is active (none: null).

Properties#

active#

readonly active: number | null

Defined in: editor/src/combobox/keys.ts:11

open#

readonly open: boolean

Defined in: editor/src/combobox/keys.ts:10


Keyed#

Defined in: editor/src/combobox/keys.ts:18

The answer to one key.

Properties#

action#

readonly action: ComboboxAction

Defined in: editor/src/combobox/keys.ts:20

handled#

readonly handled: boolean

Defined in: editor/src/combobox/keys.ts:22

Whether the combobox consumes the key; any other key keeps its native meaning.

state#

readonly state: ComboboxState

Defined in: editor/src/combobox/keys.ts:19

Type Aliases#

ComboboxAction#

ComboboxAction = "none" | "pick" | "enter" | "clear"

Defined in: editor/src/combobox/keys.ts:15

What a key asks of the combobox’s user besides the next state.

Functions#

announcement()#

announcement(count, loading): string

Defined in: editor/src/combobox/keys.ts:90

The status region’s words for count options, or for a search still running.

Parameters#

count#

number

loading#

boolean

Returns#

string


keyed()#

keyed(state, key, alt, count, text, expanded): Keyed

Defined in: editor/src/combobox/keys.ts:38

The answer to key (a KeyboardEvent.key) pressed with or without Alt in state, over count options and the field’s text; expanded says whether the list is shown, which an open state with nothing to show (no option, no search running, no content for no results) is not. An active option outside the options counts as none. Alt changes only the two arrows. Escape closes a shown list; with none shown it clears the text.

Parameters#

state#

ComboboxState

key#

string

alt#

boolean

count#

number

text#

string

expanded#

boolean

Returns#

Keyed


typed()#

typed(text): ComboboxState

Defined in: editor/src/combobox/keys.ts:85

The state after typing gives the field text: open with text, closed without, none active.

Parameters#

text#

string

Returns#

ComboboxState