Breaking changes in v2.0
- Please upgrade
data-autocomplete-url=
todata-autocomplete-url-value=
Improvements
-
The
<li role="option">
elements in search results can now contain complex HTML, and the desired text for the visible<input type="text">
field can be explicitly specified withdata-autocomplete-label
See the example application's new results-complex.html for ideas
-
New option
data-autocomplete-submit-on-enter-value=true
submits the form after the autocomplete selection via keypress Enter -
If you restrict the high of your search results, e.g.
<ul data-autocomplete-target="results" style="max-height: 10rem; overflow-y: scroll;"
>`, users who use keyboard to navigate up and down the results will always have their selected item scrolled into view -
If the visible input has
autofocus
attribute (e.g.<input autofocus="autofocus">
then it now focuses on that input so user can start typing. -
Skip
aria-disabled
elements when navigating between siblings -
New events
input
andchange
dispatched to it when the users selects a new value from the autocomplete. This allows you to bind subsequent behavior directly to the<input type=hidden>
element. -
'X-Requested-With': 'XMLHttpRequest'
is sent in the headers with every search request