private readonly queryInput: HTMLInputElement;
private readonly typeInput: HTMLSelectElement;
private readonly delimiter: HTMLDivElement;
- private readonly filtersContainer: HTMLElement;
+ private readonly filtersContainer: HTMLDetailsElement;
private searchID: number | undefined = undefined;
private pages = 0;
private activePage = 1;
this.form = document.getElementById("extendedSearchForm") as HTMLFormElement;
this.queryInput = document.getElementById("searchQuery") as HTMLInputElement;
this.typeInput = document.getElementById("searchType") as HTMLSelectElement;
- this.filtersContainer = document.querySelector(".searchFiltersContainer") as HTMLElement;
+ this.filtersContainer = document.querySelector(".searchFiltersContainer") as HTMLDetailsElement;
this.delimiter = document.createElement("div");
this.form.insertAdjacentElement("afterend", this.delimiter);
this.showSearchResults(template);
}
else if (Object.keys(this.getFormData()).length > 4) {
- // If no results are found and advanced filters are active,
- // make sure that the corresponding area is shown,
- this.filtersContainer.setAttribute("open", "");
+ // Show the advanced filters when there are no results
+ // but advanced filters are applied.
+ this.filtersContainer.open = true;
}
}
updateQueryString(searchAction) {