Closed (fixed)
Project:
Search API Autocomplete
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2016 at 09:48 UTC
Updated:
10 Dec 2016 at 11:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jofitzMost of the javascript is no longer necessary because it is covered by the jQueryUI auto-complete.
This patch uses similar methods to the previous javascript to auto-submit the form if the auto-submit class is present.
Comment #3
dawehnerNice simplification!
It would be nice to have a one line summary of what this line is doing.
Could you use
$.extend()maybe?Comment #4
jofitzAdd a line of explanation.
@dawehner How do you suggest
$.extend()could be used?Comment #5
drunken monkeyWould be great if this now worked better in D8 and we don't need all those workarounds anymore. So, thanks for proposing this, and also fixing auto-submit!
However, you also remove some other code, implementing functionality specific to this module: linked results (which will take you to a new page, not just select a suggestion), custom autocomplete script paths, customized delays, and maybe others. I can't imagine D8's autocomplete already provides all of these, and even if it does, we'd have to integrate with it properly, I guess. (Or is this already done?)
So, unless this will still be working, please don't just remove all other code as well.
Also, I think we should still have the check whether
Drupal.autocompleteis even set before doing anything else, as a safety precaution. Yes, our script should never be included without Core'sautocomplete.js, but I'd say it's better to be on the safe side. (Or are there examples in Core that assume that this is always working correctly? I guess with the Libraries system, this is now really a lot less likely to go wrong.)Comment #6
dawehnerYeah, the library system really ensures that this cannot go wrong, and well, if this goes wrong, there is more broken on your site, for sure.
Comment #7
jofitz@drunken monkey, perhaps you are right, I may have got a little delete-happy so I have re-instated what I removed. None of it will ever run because it is surrounded by a condition that will be FALSE in D8, but it can serve as a reminder for other tasks that need to be completed.
Comment #8
ressaI just tested the patch, and it does indeed activate the auto-submit function, thanks @Jo Fitzgerald!
#2825703: Changing settings don't take effect is still an issue, though - values in "Minimum length of keywords for autocompletion" and "Delay in ms" is ignored.
Comment #9
ressaAuto-submit works as expected after applying the patch.
Comment #11
drunken monkeyWell, I guess it's an improvement over what we currently have.
Added a
@todoand committed.Thanks again!