Skip to content

Commit

Permalink
fix: trigger year accordion by checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviareichl committed Jan 21, 2025
1 parent 50696b6 commit d8d24a2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions components/search-filter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ function toggleShowMore() {
showMore.value = !showMore.value;
}
function toggleYearChecked() {
yearChecked.value = !yearChecked.value;
function resetSlider() {
setTimeout(() => {
sliderValue.value = [slider.min, slider.max];
}, 100);
Expand Down Expand Up @@ -446,7 +445,14 @@ function updateSelectedCheckboxes(id: string, isChecked: boolean) {
<Separator class="bg-frisch-orange"></Separator>
</div>
<div class="pb-4">
<Accordion type="single" collapsible>
<Accordion
type="single"
collapsible
@update:model-value="
resetSlider();
addCheckbox('year');
"
>
<AccordionItem v-model:open="yearChecked" value="year">
<AccordionTrigger
class="grid w-full grid-cols-[auto_auto_1fr] place-items-end items-center gap-2"
Expand All @@ -458,10 +464,6 @@ function updateSelectedCheckboxes(id: string, isChecked: boolean) {
type="checkbox"
class="size-4 appearance-none border border-frisch-orange bg-white checked:appearance-auto checked:accent-frisch-orange"
:checked="yearChecked"
@change="
toggleYearChecked();
addCheckbox('year');
"
/>
</div>
<div class="text-lg">Erscheinungsjahr</div>
Expand Down

0 comments on commit d8d24a2

Please sign in to comment.