See https://www.woltlab.com/community/thread/295502-kategorie-auswahl-ist-verrutscht/
{event name='searchFilters'}
</div>
+ <div class="searchFiltersTitle" aria-hidden="true" hidden></div>
+
{foreach from=$objectTypes key=objectTypeName item=objectType}
{if $objectType->isAccessible() && $objectType->getFormTemplateName()}
<div class="searchFilters objectTypeSearchFilters" data-object-type="{$objectTypeName}" hidden>
}
private changeType(): void {
+ let hasVisibleFilters = false;
document.querySelectorAll(".objectTypeSearchFilters").forEach((filter: HTMLElement) => {
- filter.hidden = filter.dataset.objectType !== this.typeInput.value;
+ if (filter.dataset.objectType === this.typeInput.value) {
+ hasVisibleFilters = true;
+ filter.hidden = false;
+ } else {
+ filter.hidden = true;
+ }
});
+
+ const title = document.querySelector(".searchFiltersTitle") as HTMLElement;
+ if (hasVisibleFilters) {
+ const selectedOption = this.typeInput.selectedOptions.item(0)!;
+ title.textContent = selectedOption.textContent!.trim();
+
+ title.hidden = false;
+ } else {
+ title.hidden = true;
+ }
}
private async search(): Promise<void> {
});
}
changeType() {
+ let hasVisibleFilters = false;
document.querySelectorAll(".objectTypeSearchFilters").forEach((filter) => {
- filter.hidden = filter.dataset.objectType !== this.typeInput.value;
+ if (filter.dataset.objectType === this.typeInput.value) {
+ hasVisibleFilters = true;
+ filter.hidden = false;
+ }
+ else {
+ filter.hidden = true;
+ }
});
+ const title = document.querySelector(".searchFiltersTitle");
+ if (hasVisibleFilters) {
+ const selectedOption = this.typeInput.selectedOptions.item(0);
+ title.textContent = selectedOption.textContent.trim();
+ title.hidden = false;
+ }
+ else {
+ title.hidden = true;
+ }
}
async search() {
var _a;
margin-top: 20px;
}
+.searchFiltersTitle {
+ align-items: center;
+ color: $wcfContentDimmedText;
+ display: flex;
+ margin-top: 10px;
+
+ &::before {
+ border-top: 1px solid $wcfContentBorderInner;
+ content: "";
+ flex: 0 0 20px;
+ margin-right: 10px;
+ }
+
+ &::after {
+ border-top: 1px solid $wcfContentBorderInner;
+ content: "";
+ flex: 1 0 auto;
+ margin-left: 10px;
+ }
+
+ & ~ .searchFilters {
+ margin-top: 10px;
+ }
+}
+
@include screen-md-up {
.searchFilters {
columns: 2;
.searchFilters > :is(div, dl) {
break-inside: avoid-column;
+
+ /* work-around for Firefox */
+ overflow: hidden;
}
.searchFiltersContainer .searchButton {