AisSearchInput
AisSearchInput provides a branded search input. The input includes the search icon as decoration and exposes a control to clear input when the search has a value. This component also supports all the properties of AisInput.
Props
v-model
Use the v-model directive to bind to the search input's value. v-model uses the modelValue prop under the covers. See Vue's documentation for details.
busy
Use the busy prop to indicate that the search input is busy. The default value is false. This prop is commonly used when a search triggers an asynchronous action and must await a response. The busy status will override the search input's clear input control (close icon).
clearable
The clearable prop enables the clear control (i.e. close icon) when the input has a value. clearable is true by default. However, it may be useful to toggle clearable when using AisSearchInput in another component. For instance, a typeahead may not want to show the clear control as the user is entering the search query, but then show the control once the user has selected a specific value.
clearButtonLabel
Provide a text label for screen readers for the button that clears the input value. Default value is Clear search.
Events
@update:modelValue
AisSearchInput uses Vue's standard v-model configuration. The model will be passed down to the input. As a result, it will fire the @update:modelValue event whenever the input's value changes. See AisInput for more details.
@clear
The @clear event will fire when the user clicks the close button that appears when the input has a value. The input will receive focus on the @clear event, and the event's payload will contain the previous value.
Methods
focus()
AisSearchInput exposes a focus() method to programmatically focus the input element. The method can be invoked through a template ref specified on a AisSearchInput component.