diff --git a/hypha/templates/base.html b/hypha/templates/base.html index aa88791f01..eaf66bb019 100644 --- a/hypha/templates/base.html +++ b/hypha/templates/base.html @@ -132,11 +132,14 @@ const selectElements = document.querySelectorAll("[data-js-choices]"); selectElements.forEach((selectElement) => { - new Choices(selectElement, { - shouldSort: false, - allowHTML: true, - removeItemButton: true, - }); + if (!selectElement.hasChoicesInstance) { + const choicesInstance = new Choices(selectElement, { + shouldSort: false, + allowHTML: true, + removeItemButton: true, + }); + selectElement.hasChoicesInstance = true; + }; }); const choicesElements = document.querySelectorAll(".choices__input--cloned") @@ -146,7 +149,8 @@ const minWidth = window.getComputedStyle(choiceElement).getPropertyValue("min-width"); choiceElement.addEventListener("focus", () => { if (choiceElement) { - choiceElement.placeholder = "" + choiceElement.placeholder = "Search..." + choiceElement.style.minWidth = '7ch'; } });