Skip to content

Autocomplete

Properties

PropertyTypeDefaultDescription
labelstring''Label text for the input field.
placeholderstring''Text displayed when no value is entered in the input field.
suggestSourcestring|Function|Promise<any>Defines the data source that generates matching data based on key input.
suggestCountnumber6Number of items to be displayed in the suggestion list.
labelFieldstring|FunctionnullDefines the field that determines the value of items to be displayed.
closeOnSelectbooleantrueDefines whether to automatically close the suggestion list upon item selection.
closeOnFocusOutbooleantrueDefines whether to automatically close the suggestion list on focus out.
closeOnOutsideDownbooleantrueDefines whether to automatically close the suggestion list on outside click.
inputValuestring''Current value entered in the input field.
minCharnumber0Minimum number of characters required to activate the suggestion list.
clearablebooleanfalseWhether to enable the reset button when the input field has a value.
delimiterOnKeysArray<number>[9, 13]Array of key codes that trigger value input when pressed by the user.
coordinateMode'global'|'relative'|'none'relativeSets the coordinate system for the popup.
selectedItemobjectThe item that was selected from the suggestion list.

Methods

MethodParametersReturn ValueDescription
focusvoidSets focus to the input field.
blurvoidRemoves focus from the input field.
openSuggestvalue?: stringbooleanOpens the suggestion list. Retrieves and displays the suggestion list using the value parameter and suggestSource property.
closeSuggestvoidCloses the suggestion list.
clearvoidResets the entered value, displayed suggestion list, and selected item.

Events

EventTypeDescription
suggest-caret-change(event: CustomEvent<{value: number; oldValue: number}>) => voidOccurs when the cursor index changes in the suggestion list.
suggest-opening(event: SuggestEvent<T>) => voidOccurs before the suggestion list opens.
suggest-open(event: SuggestEvent<T>) => voidOccurs when the suggestion list opens.
suggest-closing(event: SuggestEvent<T>) => voidOccurs before the suggestion list closes.
suggest-close(event: SuggestEvent<T>) => voidOccurs when the suggestion list closes.
suggest-item-down(event: SuggestEvent<T>) => voidOccurs when mouse down on a suggestion list item. Occurs when selectOnClick is false.
suggest-item-click(event: SuggestEvent<T>) => voidOccurs when mouse click on a suggestion list item. Occurs when selectOnClick is true.
suggest-select(event: SuggestEvent<T>) => voidOccurs when a specific item is selected from the suggestion list.
value-change(event: CustomEvent<{value: string; oldValue: string}>) => voidOccurs when the value property changes.
input(event: CustomEvent<{value: string; trigger: InputEvent}>) => voidOccurs when the input element's value changes.
keydown(event: CustomEvent<{value: string; trigger: KeyboardEvent}>) => voidOccurs when a key is pressed on the input element.
keyup(event: CustomEvent<{value: string; trigger: KeyboardEvent}>) => voidOccurs when a key is released on the input element.
focusin(event: CustomEvent<{trigger: Event}>) => voidOccurs when focus is received.
focusout(event: CustomEvent<{trigger: Event}>) => voidOccurs when focus is lost.