stefanocudini / bootstrap-list-filter

Search widget to filter Bootstrap lists
https://opengeo.tech/bootstrap-list-filter/
MIT License
99 stars 31 forks source link

Option `itemChild` doesn't handle multiple element selector #8

Closed jerone closed 9 years ago

jerone commented 9 years ago

The option itemChild doesn't take in account multiple element selector. The jQuery find method does support this. For example if I want to use { itemChild: 'a,span' }, the logic to hide all not matched elements will overrule all previous elements.

Use case:

<li class="list-group-item">
  <a href="#">Home</a>
  <span class="label label-default">keyword</span>
</li>
$('#searchlist').btsListFilter('#searchinput', {itemChild: 'a,span'});

Ignoring the itemChild option in this case won't work, as then the method .text() is called, which - with above usecase - will result in the result Homekeyword (notice the absent space between the words Home and keyword).