The ComboBox provides suggestions that appear while the user types in its input field.
To enable the list with suggestions, set the
suggest property of the ComboBox to
true. Whenever the user modifies the input value, the ComboBox automatically completes the user input with the first text match. If the first text match does not begin with the current user input, the ComboBox displays no suggestions.
To set the state of the list:
You can also retrieve the current open state of the suggestion list by using the
You can enable the user to manually toggle between the open and close state of the suggestion list by setting the
toggle method. If set to
true, the method defines that the suggestion list is open. If set to
false, the method defines that the suggestion list is closed.
The following example demonstrates how to configure an initially opened ComboBox.
close events are emitted right before the suggestion list is about to open or close. To prevent the corresponding action, call the
preventDefault method of the event argument.
The following example demonstrates how to prevent the closing of the suggestion list.