Vue-autosuggest is a Vue.js component designed for building accessible autosuggest, autocomplete, and typeahead input fields. It is currently stable at version 2.2.0 and receives regular updates, often focusing on WAI-ARIA compliance and bug fixes, with new features introduced periodically. Key differentiators include its WAI-ARIA completeness, offering full control over rendering through custom components or built-in defaults, supporting multiple sections for suggestions, and being CSS-agnostic, giving developers complete styling freedom. It also facilitates easy integration with AJAX data fetching for dynamic suggestion lists. The component is rigorously tested and aims for a resilient architecture, providing a robust solution for interactive search inputs.
npm install vue-autosuggestVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes a Vue app with the VueAutosuggest component, demonstrating basic setup with static suggestions, input handling, and selection. It showcases both global registration and local component usage patterns.
Migrate to `v-model` for input binding. Replace deprecated event listeners with `@input`, `@focus`, `@blur`, `@selected` (for item selection), `@opened`, and `@closed` (for suggestion list visibility).
Review custom CSS or JS that targets WAI-ARIA attributes (`role="combobox"`, `aria-controls`) and adjust selectors to account for their new positions on wrapper elements. Rely on provided CSS classes for styling instead.
Ensure that the `data` array within each suggestion object is never `null`. Filter out `null` data entries before passing them to the `suggestions` prop, or update to `v2.0.4` or newer.
Update to `v2.0.3` or newer to ensure `inputProps` reactivity. If updating is not an option, consider using a `key` prop on the `vue-autosuggest` component to force re-render when `inputProps` change.
Update to `v2.0.1` or newer. If you cannot update, explicitly set `inputProps.autocomplete = 'off'` to enforce the behavior.
Ensure that the `data` property of all suggestion objects is an array, even if empty, and not `null`. Upgrade to `vue-autosuggest@2.0.4` or higher to handle this gracefully.
Update to `vue-autosuggest@2.0.3` or a newer version to enable reactivity for `inputProps`.
Upgrade to `vue-autosuggest@2.1.1` or a newer version, which includes a fix that ensures unique keys for section slots.
Update to `vue-autosuggest@2.1.2` or later. These versions include fixes for ARIA attribute conformance, ensuring correct accessibility implementation.