1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed I have noticed a bug with filter_list.js when it comes to filtering ajax with groups

Discussion in 'Resolved Bug Reports' started by Uniphix, Sep 12, 2014.

  1. Uniphix

    Uniphix Active Member

    In filterAjax function find

    Code:
    var $items = $children.filter('.listItem'), items = [];
                    $items.each(function(i, el) {
                        items[i] = new XenForo.FilterListItem($(el));
                    });
    and replace with

    Code:
    var $items = $children.filter('.listItem').add($children.find('.listItem')), items = [];
                    $items.each(function(i, el) {
                        items[i] = new XenForo.FilterListItem($(el));
                    });
    
    as it should be find and filter, not just filter. Reason why is that filter is only searching the top elements in this case if I have 3 groups, therefore they are not .listItem therefore items will return when in fact I have maybe 5 listItem inside of the groups. Thus, it should be filtering the top and adding the children by using find as well. When I tested it it worked in both situations much better.

    Upx
     
  2. Mike

    Mike XenForo Developer Staff Member

    This seems reasonable, though I would note that I don't think the ajax-based filtering really has grouping in mind so there may be a few other oddities.
     

Share This Page