Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

259
Visualizações
Isotope Search Function Stopped Working After Applying Filter

So I have this unknown issue with my code, everything seems to be working fine; the search works, the filter works, but when I try to search after applying a filter, it no longer works.

$('.select').on('click', '.filter-dropdown', function() {
    var parent = $(this).closest('.select');
    if (!parent.hasClass('is-open')) {
        parent.addClass('is-open');
        $('.select.is-open').not(parent).removeClass('is-open');
    } else {
        parent.removeClass('is-open');
    }
}).on('click', 'ul>li', function() {
    var parent = $(this).closest('.select');
    parent.removeClass('is-open').find('.filter-dropdown').text($(this).text());

    $('.filter-item').removeClass('active');
    $(this).addClass('active');
    var selector = $(this).attr('data-filter');

    $('.japps-container').isotope({
        filter: selector
    });
    return false;
});

var qsRegex;
var japps = $('.japps').isotope({
    // options
    itemSelector: '.japps-item',
    layoutMode: 'fitRows',
    filter: function() {
        var $this = $(this);
        var searchResult = qsRegex ? $this.text().match(qsRegex) : true;
        return searchResult;
    }
});

var $quicksearch = $('.filter-search').keyup(debounce(function() {
    qsRegex = new RegExp($quicksearch.val(), 'gi');
    japps.isotope();
}, 1));

function debounce(fn, threshold) {
    var timeout;
    threshold = threshold || 100;
    return function debounced() {
        clearTimeout(timeout);
        var args = arguments;
        var _this = this;

        function delayed() {
            fn.apply(_this, args);
        }
        timeout = setTimeout(delayed, threshold);
    };
}

Please see the CodePen link below to see the full code.

Code: https://codepen.io/bonafideboss/pen/oNeyMbQ

I could not find the problem. Please advice. Thanks in advance.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda