github afcapel/stimulus-autocomplete v2.0.0
All In on Stimulus 2

latest releases: v3.1.0, v3.0.2, v3.0.1...
3 years ago

Breaking changes in v2.0

  • Please upgrade data-autocomplete-url= to data-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 with data-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 and change 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

Don't miss a new stimulus-autocomplete release

NewReleases is sending notifications on new releases.