I use Search API autocomplete in combination with Search API pages, I made a global search that has an exposed block in the header region of my website.
Say for example a user visits the homepage of my site and typs something in the search box (for example "te"). a pop-up with suggestions is shown (for example "test", "testing"). When the user hits enter he goes to the search page. the search page search box is automatically filled automatically (with "te", "test" or "testing" depending on the user his action) and now this.populatePopup(); will run again (line 39 search_api_autocomplete.js) because input.value.length > 0. This seems a little odd to me.
Is there a way to fix this?
Kind regards,
f0ns
Comments
Comment #1
f0ns CreditAttribution: f0ns commentedComment #2
f0ns CreditAttribution: f0ns commentedComment #3
drunken monkeySo you mean that when the search page with results loads, the popup will immediately show again?
I cannot reproduce this, and also the code suggests this should only happen when a keypress is registered in the keywords input field.
Comment #4
f0ns CreditAttribution: f0ns commentedYes exactly, we have this issue on all our websites.
(tested in: Firefox, Chrome, Safari).
Looks like it also gets triggered when the value of the block is used to fill out the field on the searchpage.
Comment #5
drunken monkeyIs one of them maybe publicly visible? Could you post a link?
Maybe it is some other contrib module's JS interfering? Can you also reproduce in a clean installation of Drupal, with just the necessary modules enabled?
Comment #6
f0ns CreditAttribution: f0ns commentedI also have this on a clean install with only the necessary module installed. I mailed you the link.
Comment #7
drunken monkeyNext time, please debug your own Javascript!
Comment #8
f0ns CreditAttribution: f0ns commentedThanks for the help!