Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b714bbeb1b | |||
| 21c18f94a0 |
@@ -31,7 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" id="eventfilter-reset" class="eventfilter-reset" hidden>Filter zurücksetzen</button>
|
<button type="button" id="eventfilter-reset" class="eventfilter-reset" aria-label="Alle Filter zurücksetzen" aria-controls="{{ targetEventListId|default('eventlist')|e('html_attr') }}" hidden>Filter zurücksetzen</button>
|
||||||
|
|
||||||
<p id="eventfilter-status" class="visually-hidden" aria-live="polite"></p>
|
<p id="eventfilter-status" class="visually-hidden" aria-live="polite"></p>
|
||||||
</div>
|
</div>
|
||||||
@@ -69,13 +69,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#eventfilters .widget-select.active .ts-control {
|
#eventfilters .widget-select.active .ts-control {
|
||||||
outline: 2px solid currentColor;
|
outline: 3px solid currentColor;
|
||||||
outline-offset: 2px;
|
outline-offset: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#eventfilters .ts-control:focus-within {
|
#eventfilters .ts-control:focus-within {
|
||||||
outline: 2px solid currentColor;
|
outline: 3px solid currentColor;
|
||||||
outline-offset: 2px;
|
outline-offset: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#eventfilters .eventfilter-reset[hidden] {
|
#eventfilters .eventfilter-reset[hidden] {
|
||||||
@@ -91,9 +91,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#eventfilters .ts-wrapper.single .ts-control > input {
|
#eventfilters .ts-wrapper.single .ts-control > input {
|
||||||
width: auto !important;
|
width: auto;
|
||||||
min-width: 0 !important;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -137,12 +135,46 @@
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let shouldBlurOnChange = false;
|
||||||
|
|
||||||
return new window.TomSelect(selectElement, {
|
return new window.TomSelect(selectElement, {
|
||||||
create: true,
|
create: false,
|
||||||
sortField: {
|
sortField: {
|
||||||
field: 'text',
|
field: 'text',
|
||||||
direction: 'asc',
|
direction: 'asc',
|
||||||
},
|
},
|
||||||
|
render: {
|
||||||
|
no_results() {
|
||||||
|
return '<div class="no-results" role="option" aria-disabled="true">Keine Ergebnisse gefunden</div>';
|
||||||
|
},
|
||||||
|
no_more_results() {
|
||||||
|
return '<div class="no-more-results" role="option" aria-disabled="true">Keine weiteren Ergebnisse</div>';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onInitialize() {
|
||||||
|
const markPointerInteraction = () => {
|
||||||
|
shouldBlurOnChange = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const markKeyboardInteraction = () => {
|
||||||
|
shouldBlurOnChange = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.control.addEventListener('pointerdown', markPointerInteraction);
|
||||||
|
this.control.addEventListener('touchstart', markPointerInteraction, { passive: true });
|
||||||
|
this.control.addEventListener('keydown', markKeyboardInteraction);
|
||||||
|
this.dropdown.addEventListener('pointerdown', markPointerInteraction);
|
||||||
|
this.dropdown.addEventListener('touchstart', markPointerInteraction, { passive: true });
|
||||||
|
this.dropdown.addEventListener('keydown', markKeyboardInteraction);
|
||||||
|
},
|
||||||
|
onChange() {
|
||||||
|
if (!shouldBlurOnChange) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.blur();
|
||||||
|
shouldBlurOnChange = false;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user