Autocomplete unstable
An input that suggests completions from a list as the user types, and keeps whatever text the user enters.
Autocomplete is headless: it owns the keyboard and pointer behaviour,
the filtering, focus, placement and the data attributes, and the consumer
draws the markup. The consumer owns whether the popup is open and the
input's text, passes them as open and value, and stores what the
RequestedOpen, RequestedClose and Updated events ask for. Unlike a
Combobox it selects nothing: the text is the value, and picking an
item puts its label in the input and closes the popup. items lists
every suggestion with its label. The autocomplete filters them and hands
back autocomplete.items, the ones to draw.
Anatomy
| Part | Element |
|---|---|
inputGroup |
<div> around the input and its buttons, the anchor |
input |
<input>, the combobox |
trigger |
<button> that toggles the popup |
icon |
<span> inside the trigger |
clear |
<button> that clears the text |
label |
<div> that names the input, the list and the popup |
value |
<span> that shows the text |
backdrop |
<div>, a manual popover under the positioner |
positioner |
<div>, a manual popover placed by the autocomplete |
popup |
<div> inside the positioner |
arrow |
<div> inside the popup |
list |
<div> around the items |
row |
<div> around a row of items, with grid |
item |
<div>, one per drawn value, inside the list |
group |
<div> around items |
groupLabel |
<div> inside a group |
separator |
<div> between items |
empty |
<div>, its children drawn while no item matches |
status |
<div>, a live region for a message such as a count |
Each part takes the consumer's builder and returns it with the part
applied, and the consumer adds the children. item takes an options
object, { element, value }, and keys its element with the value, and
group and groupLabel take { element, group }, where group is the
group of the items inside. clear takes { element } and returns
undefined while the text is empty; a keepMounted field keeps it
drawn. empty drops its children while the list has items, so the live
region stays in the page.
Draw autocomplete.items, not items: it's the filtered list, which
keeps its contents while the popup animates out. autocomplete.groups
splits it by each item's group, dropping groups with nothing left, and
each group's rows splits it again by row, for grid. Every value
drawn with item has to be in items or filteredItems.
Focus stays in the input: the highlighted item is named by
aria-activedescendant, and presses on the trigger, the clear button and
the items don't take focus. In a Field, draw it as
autocomplete.input(field.control(h.input)) and name it with
field.label.
mode sets how the text and the list relate. With "list" the text
filters the items. With "both" it filters them too, and the arrow keys
show the highlighted item's label in the input until the user types,
picks or closes the popup; value keeps the typed text, which is what
filters. "inline" shows the label the same way without filtering, and
"none" neither filters nor shows it. When the typed text starts the
label, the rest is selected so the next key replaces it. Input types
that can't select text, such as "email", keep the typed text.
With inline, the list is drawn without a popup, as in a command
palette: it's always expanded, and the arrow keys move through it while
open is false.
The positioner is a manual popover, so it renders in the top layer and
needs no portal. The browser gives a popover a border, padding, a
background and overflow: auto, so reset those on the positioner and
the backdrop and style the popup instead.
With topLayer: false, the backdrop and the positioner render in place
as ordinary elements, hidden while closed, and the popup is placed and
clipped inside its containing block, as Positioning describes. The
backdrop covers that block, and the autocomplete is never modal.
CSS variables
Set on the positioner:
--anchor-width,--anchor-height: the anchor's size--available-width,--available-height: the space between the anchor and the edge of the collision boundary, for amax-height
Set on the popup: --transform-origin, the point the popup grows from.
Data attributes
Each present with an empty value or absent, except data-side,
data-align, data-popup-side and data-orientation, which hold a
value:
input:data-popup-open,data-pressed,data-popup-side,data-list-empty,data-disabled,data-readonly,data-requiredinputGroup: as on the input, withoutdata-requiredtrigger: as on the inputicon:data-popup-openclear:data-popup-open,data-disabled,data-visiblebackdrop:data-open/data-closed,data-starting-style,data-ending-stylepositioner: as on the backdrop, anddata-side,data-align,data-anchor-hidden,data-emptypopup: as on the positionerarrow: as on the backdrop, anddata-side,data-align,data-uncenteredlist:data-emptyitem:data-highlighted,data-disabledseparator:data-orientation
Keyboard
In the input, ArrowDown and ArrowUp open the popup, and then move the
highlight; with autoHighlight opening highlights the first or, for
ArrowUp, the last item. Past either end the highlight leaves the list,
and the next press wraps around; with loopFocus: false it stops at the
ends. Enter picks the highlighted item, and with nothing highlighted it
closes the popup on its keyup, leaving the keydown to submit a form.
Space picks the highlighted item while the input is empty. Escape closes
the popup, and on a closed autocomplete clears the text. Typing opens the
popup. Keys pressed while an IME composes text are left alone. With
grid, ArrowLeft and ArrowRight move between the items of a row once one
is highlighted. They follow dir or, without it, the nearest
DirectionProvider above the autocomplete or, without one, the CSS
direction of the popup or an inline list.
Form
The input is the form control: name, form and required go on it,
so the text is submitted and validated as typed. With inputInPopup
the input isn't always drawn, so the trigger is wrapped in a
display: contents span that holds a visually hidden input with them
and the text instead. With
submitOnItemClick, picking an item submits that form, the one named
by form or around the autocomplete, once the picked label is drawn.
Limits
Props can't hold functions, so filter names a matcher and a consumer
with its own filter passes the result as filteredItems, or sets
filter: "none" and filters the items it passes, as for results
fetched while typing. makeAutocompleteFilter gives the autocomplete's
matchers to a consumer's own filter. There are no default* props or
refs, no portal, and items are { value, label } rather than any object.
Example A search box whose text is in the consumer's Model
import { UiSchema } from "effect/ui"import { Html, HtmlServer } from "effect/ui/html"import { Autocomplete } from "effect/ui/kit"import { Effect, Schema } from "effect"
const tags = [ { value: "effect", label: "effect" }, { value: "schema", label: "schema" }, { value: "stream", label: "stream" }]
const SearchMessage = UiSchema.TaggedEnum({ RequestedOpenSuggestions: {}, RequestedCloseSuggestions: {}, UpdatedQuery: { query: Schema.String }})
const Search = Html.component({ name: "Search", model: Schema.Struct({ open: Schema.Boolean, query: Schema.String }), message: SearchMessage}).make({ init: () => ({ open: false, query: "str" }), update: { RequestedOpenSuggestions: ($) => $.evolve({ open: true }), RequestedCloseSuggestions: ($) => $.evolve({ open: false }), UpdatedQuery: ($, { query }) => $.evolve({ query }) }, view: (h, model) => h.form( Autocomplete(h, { props: { open: model.open, value: model.query, items: tags, name: "q" }, onEmit: { RequestedOpen: () => SearchMessage.RequestedOpenSuggestions(), RequestedClose: () => SearchMessage.RequestedCloseSuggestions(), Updated: ({ value }) => SearchMessage.UpdatedQuery({ query: value }), Highlighted: () => undefined, Settled: () => undefined }, view: (autocomplete) => h.div( autocomplete.inputGroup(h.div).children( autocomplete.input(h.input.attr("aria-label", "Search tags")), autocomplete.clear({ element: h.button })?.children("ร") ), autocomplete.positioner(h.div).children( autocomplete.popup(h.div).children( autocomplete.empty(h.div).children("No tags"), autocomplete.list(h.div).children( autocomplete.items.map(({ label, value }) => autocomplete.item({ element: h.div, value }).children(label) ) ) ) ) ) }) )})
// The input is the form field, and holds the typed text.const { html } = await Effect.runPromise(HtmlServer.renderToHtml(Search, {}))if (!/<input[^>]* name="q"/.test(html) || !/<input[^>]* value="str"/.test(html)) { throw new Error("the input doesn't hold the query")}Components
Autocomplete
unstableAn autocomplete: an input that suggests completions from a list as the user types.
Details
The parts also return plain values for markup that depends on them:
open, mounted (the popup shows, through its exit transition),
transitionStatus, inline, disabled, readOnly, required,
side and align (where the popup ended up), highlighted (the
value of the highlighted item), openMethod, which is null once the
popup closes, items (the filtered items to draw), groups and
listEmpty.
Each part writes the attributes and handles the events that the
Combobox part of the same name does, listed under Combobox,
over the ones the consumer set on the builder before the part. As
nothing is selected, the items have no aria-selected. Without
inputInPopup, the input also takes name, form and required.
It emits RequestedOpen, RequestedClose, Updated, Highlighted
and Settled.
History restore saves nothing of it: after Back, forward or a reload it
starts from init.
Signature
declare const Autocomplete: Headless<{ readonly align?: "start" | "end" | "center"; readonly alignOffset?: number; readonly anchor?: string | { readonly height: number; readonly width: number; readonly x: number; readonly y: number; }; readonly arrowPadding?: number; readonly autoHighlight?: boolean | "always"; readonly collisionAvoidance?: { readonly align?: "shift" | "none" | "flip"; readonly fallbackAxisSide?: "start" | "none" | "end"; readonly side?: "shift" | "none" | "flip"; }; readonly collisionBoundary?: "clipping-ancestors" | { readonly height: number; readonly width: number; readonly x: number; readonly y: number; } | { readonly id: string; }; readonly collisionPadding?: number | { readonly bottom?: number; readonly left?: number; readonly right?: number; readonly top?: number; }; readonly dir?: "ltr" | "rtl"; readonly disableAnchorTracking?: boolean; readonly disabled?: boolean; readonly dismissLabel?: string; readonly filter?: "endsWith" | "startsWith" | "none" | "contains"; readonly filteredItems?: readonly Array<{ readonly disabled?: boolean; readonly group?: string; readonly label: string; readonly row?: number; value: string; }>; readonly form?: string; readonly grid?: boolean; readonly highlightItemOnHover?: boolean; readonly holdExit?: boolean; readonly id?: string; readonly inline?: boolean; readonly inputInPopup?: boolean; readonly items: readonly Array<{ readonly disabled?: boolean; readonly group?: string; readonly label: string; readonly row?: number; value: string; }>; readonly keepHighlight?: boolean; readonly limit?: number; readonly locale?: string; readonly loopFocus?: boolean; readonly modal?: boolean; readonly mode?: "both" | "none" | "list" | "inline"; readonly name?: string; readonly open: boolean; readonly openOnInputClick?: boolean; readonly positionMethod?: "fixed" | "absolute"; readonly readOnly?: boolean; readonly required?: boolean; readonly side?: "left" | "right" | "top" | "bottom" | "inline-start" | "inline-end"; readonly sideOffset?: number; readonly sticky?: boolean; readonly submitOnItemClick?: boolean; readonly topLayer?: boolean; readonly value: string; readonly virtualized?: boolean;}, { readonly _tag: "Updated"; readonly reason: "none" | "trigger-press" | "outside-press" | "escape-key" | "close-press" | "focus-out" | "input-press" | "item-press" | "list-navigation" | "input-change" | "input-clear" | "clear-press" | "cancel-open"; readonly value: string;} | { readonly _tag: "Settled"; readonly open: boolean;} | { readonly _tag: "RequestedOpen"; readonly reason: "none" | "trigger-press" | "outside-press" | "escape-key" | "close-press" | "focus-out" | "input-press" | "item-press" | "list-navigation" | "input-change" | "input-clear" | "clear-press" | "cancel-open";} | { readonly _tag: "RequestedClose"; readonly reason: "none" | "trigger-press" | "outside-press" | "escape-key" | "close-press" | "focus-out" | "input-press" | "item-press" | "list-navigation" | "input-change" | "input-clear" | "clear-press" | "cancel-open";} | { readonly _tag: "Highlighted"; readonly index: number; readonly reason: "none" | "pointer" | "keyboard"; readonly value: string | null;}, { align: "start" | "end" | "center"; arrow: Part<"div", [], never>; backdrop: Part<"div", [], never>; clear: <B extends PartTarget<"button">>(__namedParameters: { readonly element: B; readonly keepMounted?: boolean; }) => ReturnType<B["attr"]> | undefined & Pick<Part<"button", [], never>, "~R">; disabled: boolean; empty: Part<"div", [], never>; group: <B extends PartTarget<"div">>(__namedParameters: { readonly element: B; readonly group: string; }) => ReturnType<B["attr"]> & Pick<Part<"div", [group: string], never>, "~R">; groupLabel: <B extends PartTarget<"div">>(__namedParameters: { readonly element: B; readonly group: string; }) => ReturnType<B["attr"]> & Pick<Part<"div", [group: string], never>, "~R">; groups: readonly Array<Group<string>>; highlighted: string | null; icon: Part<"span", [], never>; inline: boolean; input: Part<"input", [], never>; inputGroup: Part<"div", [], never>; item: <B extends Keyed<"div">>(__namedParameters: { readonly element: B; readonly value: string; }) => ReturnType<B["attr"]> & Pick<Part<"div", [value: string], never>, "~R">; items: readonly Array<{ readonly disabled?: boolean; readonly group?: string; readonly label: string; readonly row?: number; value: string; }>; label: Part<"div", [], never>; list: Part<"div", [], never>; listEmpty: boolean; mounted: boolean; open: boolean; openMethod: "mouse" | "touch" | "pen" | "keyboard" | null; popup: Part<"div", [], never>; positioner: Part<"div", [], never>; readOnly: boolean; required: boolean; row: Part<"div", [], never>; separator: Part<"div", [], never>; side: "left" | "right" | "top" | "bottom" | "inline-start" | "inline-end"; status: Part<"div", [], never>; transitionStatus: TransitionStatus; trigger: Part<"button", [], never>; value: Part<"span", [], never>;}, never, never, never, never, never, never, { readonly active: string | null; readonly activeByKey: boolean; readonly autoFirst: boolean; readonly chipsRtl: boolean; readonly closeMethod: "mouse" | "touch" | "pen" | "keyboard" | null; readonly closeQuery: string | null; readonly completion: { readonly from: string; readonly label: string; } | null; readonly focusLeft: boolean; readonly mounted: boolean; readonly openMethod: "mouse" | "touch" | "pen" | "keyboard" | null; readonly placement: { readonly align: "start" | "end" | "center"; readonly anchorHidden: boolean; readonly arrowUncentered: boolean; readonly side: "left" | "right" | "top" | "bottom" | "inline-start" | "inline-end"; } | null; readonly pressedItem: string | null; readonly pressing: boolean; readonly queryChanged: boolean; readonly removing: { readonly label: string; readonly value: string; } | null; readonly rtl: boolean; readonly saved: string | null; readonly started: boolean; readonly typeahead: { readonly matched: number; readonly typed: string; readonly typedFrom: number; };}, { readonly _tag: "RenderedFirstFrame";} | { readonly _tag: "FocusedOutside";} | { readonly _tag: "ClickedTrigger"; readonly pointerType: string;} | { readonly _tag: "FinishedTransition"; readonly open: boolean;} | { readonly _tag: "PressedOutside"; readonly pointerType: string;} | { readonly _tag: "PressedInput"; readonly pointerType: string;} | { readonly _tag: "PressedGroup"; readonly pointerType: string;} | { readonly _tag: "ChangedInput"; readonly composing: boolean; readonly inputType: string; readonly value: string;} | { readonly _tag: "PressedInputKey"; readonly chips: boolean; readonly key: string;} | { readonly _tag: "ReleasedInputKey"; readonly key: string;} | { readonly _tag: "FocusedInput";} | { readonly _tag: "BlurredInput";} | { readonly _tag: "PressedTrigger"; readonly pointerType: string;} | { readonly _tag: "ReleasedTrigger";} | { readonly _tag: "PressedTriggerKey"; readonly key: string;} | { readonly _tag: "ClickedLabel";} | { readonly _tag: "FocusedFormInput";} | { readonly _tag: "Autofilled"; readonly value: string;} | { readonly _tag: "PressedClear";} | { readonly _tag: "RequestedChipRemoval"; readonly reason: "none" | "trigger-press" | "outside-press" | "escape-key" | "close-press" | "focus-out" | "input-press" | "item-press" | "list-navigation" | "input-change" | "input-clear" | "clear-press" | "cancel-open" | "chip-remove-press"; readonly value: string;} | { readonly _tag: "PressedChipArrow"; readonly key: string;} | { readonly _tag: "EnteredItem"; readonly value: string;} | { readonly _tag: "LeftItem";} | { readonly _tag: "PressedItem"; readonly value: string;} | { readonly _tag: "ReleasedItem"; readonly button: number; readonly value: string;} | { readonly _tag: "ClickedItem"; readonly pointerType: string; readonly value: string;} | { readonly _tag: "PressedDismiss";} | { readonly _tag: "CompletedWaitBeforeResetTyping";} | { readonly _tag: "ShowedPopup";} | { readonly _tag: "ChangedPlacement"; readonly placement: { readonly align: "start" | "end" | "center"; readonly anchorHidden: boolean; readonly arrowUncentered: boolean; readonly side: "left" | "right" | "top" | "bottom" | "inline-start" | "inline-end"; };} | { readonly _tag: "ReleasedPointer"; readonly outside: boolean;} | { readonly _tag: "FoundDirection"; readonly rtl: boolean;} | { readonly _tag: "FoundChipsDirection"; readonly rtl: boolean;}, QueryEntries<{}, {}>>Constructors
makeAutocompleteFilter
unstableThe AutocompleteFilter for a locale, the runtime's when left out. It's
cached, so calling it for each render is cheap.
Signature
declare function makeAutocompleteFilter(locale?: string): AutocompleteFilterExample Filtering suggestions the consumer fetched
import { makeAutocompleteFilter } from "effect/ui/kit"
const filter = makeAutocompleteFilter("fr")filter.contains("Crรจme brรปlรฉe", "creme") // trueModels
Why an Autocomplete asks to open, close or change its text.
Signature
type AutocompleteChangeReason = typeof AutocompleteChangeReason.TypeWhat an Autocomplete emits.
Signature
type AutocompleteEvents = typeof AutocompleteEvents.TypeThe matchers an Autocomplete filters with, for a consumer's own
filter.
Details
Each takes an item's text and the query, and ignores case, accents and punctuation. An empty query matches everything.
Signature
interface AutocompleteFilter extends TextFilter {}How an Autocomplete matches its items against the text.
Signature
type AutocompleteFilterMode = typeof AutocompleteFilterMode.TypeA run of items to draw under one group label: the items whose group
is key, in order, and the same items split into rows by their
row.
Signature
interface AutocompleteGroup extends Group {}What moved the highlight.
Signature
type AutocompleteHighlightReason = typeof AutocompleteHighlightReason.TypeOne suggestion of an Autocomplete.
Signature
type AutocompleteItem = typeof AutocompleteItem.TypeHow an Autocomplete's text relates to its list.
Signature
type AutocompleteMode = typeof AutocompleteMode.TypeThe props of an Autocomplete.
Signature
type AutocompleteProps = typeof AutocompleteProps.TypeWhere an autocomplete's popup is in its transitions: "starting" for
the first frame after it opens, "ending" while it closes, null
otherwise.
Signature
type AutocompleteTransitionStatus = Engine.TransitionStatusSchemas
AutocompleteChangeReason
unstableWhy an Autocomplete asks to open, close or change its text.
Details
"trigger-press": a press on the trigger"input-press": a press on the input or the input group"outside-press": a press outside the autocomplete and the popup, other than on a scrollbar"item-press": an item was picked, with the pointer or the keyboard"close-press": the visually hidden dismiss button in the popup, for screen readers"escape-key": Escape in the input"list-navigation": ArrowDown or ArrowUp opened the popup"focus-out": focus left the autocomplete and the popup"input-change": the user edited the input's text"input-clear": the user emptied the input"clear-press": the clear button"cancel-open": the press that opened it was released away from the trigger and the popup"none": anything else, such as Enter with nothing highlighted
Signature
declare const AutocompleteChangeReason: Literals<readonly ["trigger-press", "input-press", "outside-press", "item-press", "close-press", "escape-key", "list-navigation", "focus-out", "input-change", "input-clear", "clear-press", "cancel-open", "none"]>AutocompleteEvents
unstableWhat an Autocomplete emits.
Details
RequestedOpen: asks foropento be true.RequestedClose: asks foropento be false.Updated: asks forvalueto bevalue, the new text. A pick asks for the picked label.Highlighted: reports that the highlighted item changed, tovalueatindexinautocomplete.items, or to none withnulland-1. For a virtualized list to scroll to it.Settled: reports that the popup's transitions ended, after it opened or closed.
Signature
declare const AutocompleteEvents: TaggedEnum<{ Highlighted: TaggedStruct<"Highlighted", { readonly index: Number; readonly reason: Literals<readonly ["keyboard", "pointer", "none"]>; readonly value: NullOr<String>; }>; RequestedClose: TaggedStruct<"RequestedClose", { readonly reason: Literals<readonly ["trigger-press", "input-press", "outside-press", "item-press", "close-press", "escape-key", "list-navigation", "focus-out", "input-change", "input-clear", "clear-press", "cancel-open", "none"]>; }>; RequestedOpen: TaggedStruct<"RequestedOpen", { readonly reason: Literals<readonly ["trigger-press", "input-press", "outside-press", "item-press", "close-press", "escape-key", "list-navigation", "focus-out", "input-change", "input-clear", "clear-press", "cancel-open", "none"]>; }>; Settled: TaggedStruct<"Settled", { readonly open: Boolean; }>; Updated: TaggedStruct<"Updated", { readonly reason: Literals<readonly ["trigger-press", "input-press", "outside-press", "item-press", "close-press", "escape-key", "list-navigation", "focus-out", "input-change", "input-clear", "clear-press", "cancel-open", "none"]>; readonly value: String; }>;}>AutocompleteFilterMode
unstableHow an Autocomplete matches its items against the text.
Details
"contains": the label contains the text"startsWith": the label starts with it"endsWith": the label ends with it"none": every item is drawn, for a consumer that filtersitemsitself
Matching ignores case, accents and punctuation, in the locale.
Signature
declare const AutocompleteFilterMode: Literals<readonly ["contains", "startsWith", "endsWith", "none"]>AutocompleteHighlightReason
unstableWhat moved the highlight: "keyboard", "pointer", or "none" for
the autocomplete itself, as when it opens or the list changes.
Signature
declare const AutocompleteHighlightReason: Literals<readonly ["keyboard", "pointer", "none"]>AutocompleteItem
unstableOne suggestion of an Autocomplete.
Details
value: what identifies the item, inHighlighted. Unique among the items.label: the text matched while filtering, and put in the input when the item is picked.disabled: the item can be highlighted but not picked.group: the key of the group it's drawn in, forautocomplete.groups.row: the row it's drawn in, forgrid. Neighbouring items of a group with the samerowshare a row.
Signature
declare const AutocompleteItem: Struct<{ readonly disabled: optional<Boolean>; readonly group: optional<String>; readonly label: String; readonly row: optional<Number>; value: String;}>AutocompleteMode
unstableHow an Autocomplete's text relates to its list.
Details
"list": the text filters the items"both": the text filters the items, and the arrow keys show the highlighted item's label in the input"inline": every item is drawn, and the arrow keys show the highlighted item's label in the input"none": every item is drawn, and the input only shows the text
Signature
declare const AutocompleteMode: Literals<readonly ["list", "both", "inline", "none"]>AutocompleteProps
unstableThe props of an Autocomplete.
Details
open: whether the popup shows. The autocomplete only asks, withRequestedOpenandRequestedClose.value: the input's text. The autocomplete only asks, withUpdated.items: every suggestion, in the order they're drawn.mode: how the text relates to the list, asAutocompleteModedescribes."list"when left out.filter: how the text matches the items, withmode"list"or"both"."contains"when left out.filteredItems: the items to draw, from the consumer's own filter, in place offilter.locale: the locale the filter compares in. The runtime's when left out.limit: the most items drawn. All of them when left out.autoHighlight: typing highlights the first match, so Enter picks it, and opening with the arrow keys highlights the first or last item."always"also highlights the first item whenever the list shows. False when left out.keepHighlight: the highlight stays when the pointer leaves the list. False when left out.highlightItemOnHover: the pointer highlights the item it's over. True when left out.loopFocus: the arrow keys go past the ends of the list and around. True when left out.openOnInputClick: a press on the input opens the popup. False when left out.submitOnItemClick: picking an item submits the autocomplete's form. False when left out.inline: the list is drawn without a popup and is always expanded. False when left out.inputInPopup: the input is drawn inside the popup, and the trigger is the combobox that opens it. Thevaluepart shows the text in the trigger. False when left out.grid: the items are drawn in rows, by theirrow, and the list is a grid. False when left out.virtualized: the consumer draws only some of the items, so the autocomplete doesn't scroll the highlighted one into view; scroll to it onHighlighted. False when left out.disabled,readOnly,required,name,form: as on a native<input>, and put on the input. A read-only autocomplete opens and can be browsed but not changed.id: the input's id, unless the builder has one. Generated when left out.dir: the writing direction, for the horizontal arrow keys. When left out, the nearestDirectionProvider's or, without one, the CSSdirectionof the popup or an inline list.modal: while open, the page doesn't scroll, a press outside only closes the popup, and the rest of the page is hidden from assistive technology. WithinputInPopup, the popup is also a modal dialog that Tab doesn't leave. False when left out.dismissLabel: the name of the visually hidden dismiss button in the popup."Dismiss"when left out.holdExit: keeps the closing popup shown, for an exit animation the consumer ends by clearing it.- the
Positioning.PositionerFields, for the popup,topLayer: falseamong them to draw it in place, as the module describes.sideis"bottom"when left out, and the anchor is the input group, or the input without one.
Signature
declare const AutocompleteProps: Struct<{ readonly align: optional<Literals<readonly ["start", "center", "end"]>>; readonly alignOffset: optional<Number>; readonly anchor: optional<Union<readonly [String, Struct<{ readonly height: Number; readonly width: Number; readonly x: Number; readonly y: Number; }>]>>; readonly arrowPadding: optional<Number>; readonly autoHighlight: optional<Union<readonly [Boolean, Literal<"always">]>>; readonly collisionAvoidance: optional<Struct<{ readonly align: optional<Literals<readonly ["flip", "shift", "none"]>>; readonly fallbackAxisSide: optional<Literals<readonly ["start", "end", "none"]>>; readonly side: optional<Literals<readonly ["flip", "shift", "none"]>>; }>>; readonly collisionBoundary: optional<Union<readonly [Literal<"clipping-ancestors">, Struct<{ readonly id: String; }>, Struct<{ readonly height: Number; readonly width: Number; readonly x: Number; readonly y: Number; }>]>>; readonly collisionPadding: optional<Union<readonly [Number, Struct<{ readonly bottom: optional<Number>; readonly left: optional<Number>; readonly right: optional<Number>; readonly top: optional<Number>; }>]>>; readonly dir: optional<Literals<readonly ["ltr", "rtl"]>>; readonly disableAnchorTracking: optional<Boolean>; readonly disabled: optional<Boolean>; readonly dismissLabel: optional<String>; readonly filter: optional<Literals<readonly ["contains", "startsWith", "endsWith", "none"]>>; readonly filteredItems: optional<$Array<Struct<{ readonly disabled: optional<Boolean>; readonly group: optional<String>; readonly label: String; readonly row: optional<Number>; value: String; }>>>; readonly form: optional<String>; readonly grid: optional<Boolean>; readonly highlightItemOnHover: optional<Boolean>; readonly holdExit: optional<Boolean>; readonly id: optional<String>; readonly inline: optional<Boolean>; readonly inputInPopup: optional<Boolean>; readonly items: $Array<Struct<{ readonly disabled: optional<Boolean>; readonly group: optional<String>; readonly label: String; readonly row: optional<Number>; value: String; }>>; readonly keepHighlight: optional<Boolean>; readonly limit: optional<Number>; readonly locale: optional<String>; readonly loopFocus: optional<Boolean>; readonly modal: optional<Boolean>; readonly mode: optional<Literals<readonly ["list", "both", "inline", "none"]>>; readonly name: optional<String>; readonly open: Boolean; readonly openOnInputClick: optional<Boolean>; readonly positionMethod: optional<Literals<readonly ["absolute", "fixed"]>>; readonly readOnly: optional<Boolean>; readonly required: optional<Boolean>; readonly side: optional<Literals<readonly ["top", "bottom", "left", "right", "inline-start", "inline-end"]>>; readonly sideOffset: optional<Number>; readonly sticky: optional<Boolean>; readonly submitOnItemClick: optional<Boolean>; readonly topLayer: optional<Boolean>; readonly value: String; readonly virtualized: optional<Boolean>;}>