Autocomplete Input
Overview
Use the autocomplete component to prompt the user for a text value, showing them possible matches in a dropdown menu while they type.
The user can quickly select an item from the menu rather than having to type out the whole word, which can be a real time saver.
Development
Web component development
Component reference
autocomplete
Provides predictive autocomplete list for your text list editor
Implementation
Begin by importing the AutoCompleteModule module into your application.
Then set the formControlName and bind suggestions to a list of all string values possible for the field. Set the inputStyleClass to rui-form-control. Optionally, you can bind dropdown to true if you want to show the dropdown arrow. Otherwise, just typing in the input will display the dropdown menu. Finally, bind completeMethod to your backing method to build out your filtered list.
In the typescript, create an AutoCompleteCompleteEvent interface and add a property to hold the filtered list. Then create the method called during the completeMethod event and update the filtered list based on the input.
Angular component development
Component reference
autocomplete
Provides predictive autocomplete list for your text list editor
Implementation
Begin by importing the AutoCompleteModule module into your application.
Then set the formControlName and bind suggestions to a list of all string values possible for the field. Set the inputStyleClass to rui-form-control. Optionally, you can bind dropdown to true if you want to show the dropdown arrow. Otherwise, just typing in the input will display the dropdown menu. Finally, bind completeMethod to your backing method to build out your filtered list.
In the typescript, create an AutoCompleteCompleteEvent interface and add a property to hold the filtered list. Then create the method called during the completeMethod event and update the filtered list based on the input.
Design
Figma design
| Dev Component | Design Component Name |
|---|---|
| Text input | JHA / Forms / Text Input; set State to “Watermark” if you want to show watermark text instead of user input, otherwise leave State as “Normal” |
Adobe XD design
- Sample App - Editing Form Data
| Dev Component | Design Component Name |
|---|---|
| Text input | JHA / Forms / Text Input
|