Revealing filterable doesn't show any matches if all items match. #7307

Shepard opened this Issue Apr 10, 2014 · 0 comments


None yet

2 participants

Shepard commented Apr 10, 2014

If you have a filterable with data-filter-reveal="true" and perform a search that matches all items, none are shown instead of all.

See my test page:
Enter "test" into the text field.
This should show all three items "Test 1", "Test 2" and "Test 3". Instead it shows none of them. If however you type "test 1" it shows "Test 1".

This appears to be caused by the logic in _filterItems in the fitlerable widget, in particular this code:

        // If nothing is hidden, then the decision whether to hide or show the items
        // is based on the "filterReveal" option.
        if ( hide.length === 0 ) {
            filterItems[ opts.filterReveal ? "addClass" : "removeClass" ]( "ui-screen-hidden" );
        } else {
            $( hide ).addClass( "ui-screen-hidden" );
            $( show ).removeClass( "ui-screen-hidden" );

I guess this needs a cleverer check.

Browser: Firefox 28 on Desktop (Windows 7).

@gabrielschulhof gabrielschulhof self-assigned this Apr 10, 2014
@gabrielschulhof gabrielschulhof added this to the 1.4.3 milestone Apr 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment