Skip to content

LookupFieldControl

LookupFieldControl(__namedParameters): Element

The Lookup choice: a type-ahead over a source that is searched as the respondent types, with a “use what I typed” row for an answer the source does not have.

It follows the ARIA 1.2 combobox pattern (an input with role="combobox" controlling a listbox, focus staying in the input and aria-activedescendant naming the highlighted option) and announces the result count through a polite live region.

It is always a usable text input. With no lookup source (server rendering, a consumer who passes none) it is just an <input name=…>, and so is it when a search fails; the form still submits what was typed. Nothing here touches window while rendering, so it renders on a server and hydrates cleanly.

What the form receives: the answer itself (the option’s value when one was picked, otherwise the typed text) and onExistingChange(true | false | null) for the companion key (true picked, false typed, null empty). The latter is also written as a hidden input, so a native form submission carries it too.

ChoiceFieldComponentProps

Element