diff --git a/war/src/main/js/components/autocomplete/index.js b/war/src/main/js/components/autocomplete/index.js index be4350b7aad9..9caefc6e242e 100644 --- a/war/src/main/js/components/autocomplete/index.js +++ b/war/src/main/js/components/autocomplete/index.js @@ -43,9 +43,13 @@ function init() { }; } + function getMaxSuggestionCount(e) { + return parseInt(e.dataset["maxsuggestions"]) || 10; + } + function createAndShowDropdown(e, suggestions) { const items = suggestions - .splice(0, 10) + .splice(0, getMaxSuggestionCount(e)) .map((s) => convertSuggestionToItem(s, e)); if (!e.dropdown) { Utils.generateDropdown(