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

Problem/Motivation

This solution helps to improve autocompletion from a UX perceptive. See screenshot:

Proposed resolution

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:
#2442025: Cache rebuild is applying before library_info_alter() in module install phase.

Remaining tasks

- 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.

API changes

New configurations on formAPI could be added to have the same configuration options from API then from UI.

Files: 
CommentFileSizeAuthor
search_autocomplete.png17.62 KBDom.

Comments

Dom.’s picture

Title: Multifield selection and UX improvment on autocomplete » UX improvment on autocompletion
Dom.’s picture

Dom.’s picture

The multifield and view integration can be included regardless of #2346973: Replace jQuery UI autocomplete with Select2 although it would have high impacts on menu generation. Waiting to see evolution of this issue, but still opened to discussion on interest of proposal in the meanwhile.

mgifford’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Active » Postponed

I think this probably should be bumped to 8.1.

mgifford’s picture

Status: Postponed » Active

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.