This is just me, offering to include jquery.autocomplete.js file from Search Autocomplete (bran 8.x) to Core in replacment for misc/autocomplete.js
This solution helps to improve autocompletion from a UX perceptive. See screenshot:
The proposal is to include the features of Search Autocomplete module on Core. As a POC, please have a look at version 8.x which replaces autocomplete.js from Core with a custom js script. This new script allows:
- full compatibility with current formAPI and callback syntax (label, value array)
- compatibility with views (optionnal) to create callback, see the example above. This helps to create multifield results, even "grouped by" as seen in the picture.
- eventually the UI to create autocompletion configurations off any fields without coding (allow activate/desactivate autocompletion for instance)
Main interest is that the approach extend current autocomplete behavior, and is fully compatible with current existing.
NOTE: if you want a try, please refresh cache after install as I could not solve this for this POC:
- Extend formAPI to use configurations from UI or create configuration from code directly. This will also let default configurations be targetted using hook_form rather then selectors as per current implementation limit.
- Create disabled by default configurations to provide interesting autocompletions (search block and search page for instance)
- Code review the JS, some of the stuff are "just working for POC" at the moment.
User interface changes
1: Better UX on autocompleted fields.
2: Eventually, a UI to configure, activate and handle completions on your site.
New configurations on formAPI could be added to have the same configuration options from API then from UI.