Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion js/utils/jquery-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jQuery(document).ready(function () {

// Fix autocomplete dropdown position to stay anchored to the search input.
jQuery(document).ready(function () {
let retries = 0;
const MAX_RETRIES = 20;

const fixAutocompletePosition = function () {
const $search = jQuery("#search");
if ($search.length && $search.data("ui-autocomplete")) {
Expand All @@ -50,7 +53,8 @@ jQuery(document).ready(function () {
}, 0);
};
}
} else {
} else if (retries < MAX_RETRIES) {
retries++;
setTimeout(fixAutocompletePosition, 500);
}
};
Expand Down
Loading