Free solo
Allows arbitrary values that are not bound to the options — ideal for a search or “creatable” field. freeSolo lets the raw text become the value, and a createFilterOptions filter surfaces an “Add …” entry so users can commit new values.
Overview
Examples
Usage
Import AutocompleteComponent and configure it with the inputs below. The full runnable source is on the Examples tab.
<autocomplete
[options]="films"
[freeSolo]="true"
[(value)]="value"
[filterOptions]="filter"
appearance="outline"
label="Search" />API
This example demonstrates the inputs below. See the Autocomplete introduction for the complete API — every input, output, content template and filter helper.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
freeSolo | boolean | false | Allow arbitrary values not bound to the options. |
filterOptions | FilterOptionsFn<T> | createFilterOptions() | Custom filtering function. Pass passThroughFilter for server-side search. |
selectOnFocus | boolean | !freeSolo | Select the input text on focus. |
clearOnBlur | boolean | !freeSolo | Clear the input text on blur when there is no value. |
handleHomeEndKeys | boolean | !freeSolo | Move highlight with Home/End keys. |
