Before going any further, know this:
Much of the work on this task took place here: #2346973: Improve usability and accessibility of long select lists. It eventually became apparent that this needed its own issue
- Are you looking for the issue regarding a drop-in replacement for jQuery UI autocomplete, for stuff like entity reference fields? this is that issue
- Are you looking for the issue regarding UX improvments to
<select>
elements, making it easier to deal with long lists of options? That is a different issue, and it is here: #2346973: Improve usability and accessibility of long select lists
Problem/Motivation
We are in the process of deprecating jQuery UI in core. jQuery UI's autocomplete is among the components that need to be removed/replaced.
As mentioned in the parent issue: #3067261: [Plan] Remove jQuery UI components used by Drupal core and replace with a set of supported solutions
The OpenJS Foundation lists jQuery UI as an Emeritus project in https://openjsf.org/projects/ which is described as:
Emeritus projects are those which the maintainers feel have reached or are nearing end-of-life
Well before the need to deprecate jQueryUI emerged in mid-2019, there has been interest in replacing jQueryUI with something with better UX and accessibility (which is evident in this issue being created several years prior to mid-2019).
Proposed resolution
Replace jQuery autocomplete with the Awesomplete library. Awesomplete was one of ten libraries evaluated as a replacement for jQueryUI autocomplete. The full evaluation (with a prototype that can be used with taxonomy fields) is in comment on the issue this originated from: #223. This was chosen over the others for several reasons, including
- It was the only library reviewed to not have any glaring accessibility issues
- Unlike most candidates, the functionality is applied to the existing text field. Most of the other options require select elements or hide the text field and create pseudo-inputs from other elements, creating entirely new markup that could result in broken forms and frustrated contrib developers.
- Awesomplete is in the Joomla 4 alpha, which means another large project has vetted it and has interest in its continued support
- A review of its Github suggests that important issues actually get addressed
(in other words, it's easily the most accessible, least disruptive option chosen so far)
Steps taken prior to the proposed resolution
Several other options were evaluated. Note that all links to evaluations go a separate issue: #2346973: Improve usability and accessibility of long select lists, the issue that this originated from.
- https://github.com/jshjohnson/ChoicesEvaluation (#189)
- https://harvesthq.github.io/chosen/Evaluation (#194)
- https://github.com/Mobius1/SelectrEvaluation (#195)
- https://github.com/alphagov/accessible-autocomplete (prototype at #182, great accessibility but not considered as it does not support select/multiselect It is strictly for providing suggestions to single-value text fields)
- https://github.com/HemantNegi/jquery.sumoselectEvaluation (#201)
- http://ivaynberg.github.io/select2 (of which https://github.com/woocommerce/selectwoo is a fork of, created to improve accessibility) Evalulation (#193)
- Custom library based on https://react-select.comEvaluation (#200)
- https://selectize.github.io/selectize.js/Evaluation (#199)
- https://leaverou.github.io/awesomplete/Evaluation and prototype (#223)
- https://github.com/github/auto-complete-elementEvaluation (#222)
Other than Awesomplete, nontrivial accessibility problems identified in each evaluation. These problems were discovered from general accessibility testing. In each case, enough issues were found that it wasn't worth devoting additional time to strictly checking against W3 specs.
Remaining tasks
- Accessibility review
- JS review
- FE Manager review
- UX review
- Product Manager review
- (probably more reviews, this is a major change)
Unlike most experimental module additions, this is an allowed change in 8.9.x/9.0.x because it's not just a feature; it's also a critical security hardening task.
User interface changes
Yes.
API changes
Yes.