Our test group strikes again!
The instant search was performing too fast (Yes, it was a first for us to hear the test group say "It performs too fast"). Basically, the instant search box is trigged on the key up event. This resulted in a search being trigged for each key typed by an end user. For longer search terms, this resulted in a very weird experience for our test group.
Our solution was to delay execution of the search until at least 300 milliseconds of no user input had occurred (the user had stopped typing).
Edit .\assets\js\phpmyfaq.js at line 1935 (Version 2.8.22) by replacing the entire autoSuggest function with:
Code: Select all
/**
* Auto-suggest function for instant response
*
* @return void
*/
var autoSuggestTimer;
var autoSuggest = function autoSuggest() {
$('input#instantfield').keyup(function () {
if (autoSuggestTimer !== null) {clearInterval(autoSuggestTimer);}
autoSuggestTimer = setTimeout(function() {
var search = $('#instantfield').val(),
language = $('#ajaxlanguage').val(),
category = $('#searchcategory').val();
if (search.length > 0) {
$.ajax({
type: "POST",
url: "ajaxresponse.php",
data: "search=" + search + "&ajaxlanguage=" + language + "&searchcategory=" + category,
success: function (searchresults) {
$("#instantresponse").empty();
if (searchresults.length > 0) {
$("#instantresponse").append(searchresults);
}
}
});
}
}, 500);
});
$('#instantform').submit(function () {
return false;
});
};
autoSuggest();
Hope this helps someone else!