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.
Comment | File | Size | Author |
---|---|---|---|
search_autocomplete.png | 17.62 KB | Dom. |
Comments
Comment #1
Dom. CreditAttribution: Dom. commentedComment #2
Dom. CreditAttribution: Dom. commentedComment #3
Dom. CreditAttribution: Dom. commentedThe multifield and view integration can be included regardless of #2346973: Improve usability, accessibility, and scalability of long select lists 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.
Comment #4
mgiffordI think this probably should be bumped to 8.1.
Comment #5
mgiffordComment #13
bnjmnmI found this as it's related to an issue I'm working on: #2346973: Improve usability, accessibility, and scalability of long select lists
I am going to close this as "Won't Fix". I definitely see the appeal in this feature, but I think it's more appropriate for contrib than it is for core. The issue that stands out for me is how this would impact screenreader users. Expanding the autocomplete results beyond a title label would require significantly more listening time and make it difficult to retain all options in working memory. I think it's very unlikely that this would get through the accessibility gate. (fortunately, the 3.5 yrs of inactivity suggest the demand isn't too high for this to be in core anyway)
That said, this would be a contrib module many folks would likely enjoy, and could probably have strong accessibility, even if isn't quite core-gate levels of accessibility.