Skip to content

Commit

Permalink
Fix warnings and add search indicator placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepsajan0 committed Jan 26, 2025
1 parent 72132e2 commit fc00d3f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hypha/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,14 @@
const selectElements = document.querySelectorAll("[data-js-choices]");

selectElements.forEach((selectElement) => {
new Choices(selectElement, {
shouldSort: false,
allowHTML: true,
removeItemButton: true,
});
if (!selectElement.choicesInstance) {
const choicesInstance = new Choices(selectElement, {
shouldSort: false,
allowHTML: true,
removeItemButton: true,
});
selectElement.choicesInstance = choicesInstance;
};
});

const choicesElements = document.querySelectorAll(".choices__input--cloned")
Expand All @@ -145,7 +148,7 @@
const minWidth = window.getComputedStyle(choiceElement).getPropertyValue("min-width");
choiceElement.addEventListener("focus", () => {
if (choiceElement) {
choiceElement.placeholder = ""
choiceElement.placeholder = "Search..."
}
});

Expand Down

0 comments on commit fc00d3f

Please sign in to comment.