patrickkunka / mixitup

A high-performance, dependency-free library for animated filtering, sorting, insertion, removal and more
https://www.kunkalabs.com/mixitup/
4.52k stars 734 forks source link

Problem with Filter on Load, and adding additional filters to that #578

Open sfdavey opened 3 years ago

sfdavey commented 3 years ago

Love Mixitup, but I'm having a problem finishing my solution

https://www.thefilmcollaborative.org/films/index_new4

I've set it up so that it filters on load for the past two years (2021, 2020), but when one applies any of the other filters after that, these filters turn off. This only happens on load because if I select 2021 & 2020 again manually, additional filters are applied without turning off others. I'm using bootstrap so I had to do a workaround with the "active" class state.

var containerEl = document.querySelector('.container');

var mixer = mixitup(containerEl, {
    multifilter: {
        enable: true
    },
    animation: {
        effects: 'fade translateZ(-100px)',
        effects: 'fade',
        duration: 700
    },
    load: {
        filter: '.year_2020, .year_2021'
    },
    selectors: {
        control: '[data-mixitup-control]'
    },
    controls: {
        toggleDefault: 'none'
    }

Thanks,

David

eiswurm commented 2 years ago

I'm having the same issue. Using a load filter and checking other filters (logicBetweenGroups: 'and'), the loaded filter turns off.