Skip to main content

Module autocomplete

Module autocomplete 

Expand description

Autocomplete — a text field with a suggestion list that floats below it — and the Suggestion rows that list shows.

A real TextInput (so it inherits selection, clipboard, IME, caret navigation and theming for free, per crates/sdk/ui-core/HIG.md §8) with a suggestion popover drawn in the overlay pass so it composites above sibling content.

Any app attaches a suggestion source — a closure via with_suggester, or a reactively-computed list via set_suggestions — and completions recompute whenever the typed text changes.

Typing opens the dropdown; Down/Up move the highlight; Enter accepts (the highlighted suggestion, or the typed text, which Enter then goes on to the host with, so a form’s default action runs); Tab completes to the highlight without accepting; Esc or an outside click cancels — the outside click is not consumed, so it still reaches the host. The outcome is polled once via take_outcome, rising-edge like TextInput::take_dirty.

The editable path bar in the file manager is the canonical consumer, but the widget knows nothing about paths.

Structs§

Autocomplete
AutocompleteProps
A field that suggests completions under it as it is typed into: a search over a site’s catalogue, a mention, a command. The suggestions are what the view gives it; a chosen one fills the field and is reported.
CheckColumn
What every row of a suggestion list shares: whether any row shows a state, so they all keep the check column.
Suggestion
One completion offered in the dropdown.
SuggestionPerson
Who a Suggestion names, for its leading avatar.
SuggestionProps
One completion an Autocomplete offers.

Enums§

AutocompleteOutcome
How the most recent interaction ended. Returned once by Autocomplete::take_outcome.
RowRole
What a row of a SuggestionList is.

Type Aliases§

Suggester
A suggestion source: given the current text, return the completions to show.
SuggestionList
The floating list of suggestions under a field: the one list engine (FloatingList), its rows Suggestions.