Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

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

Closed
Shepard opened this issue Apr 10, 2014 · 0 comments · Fixed by #7309
Closed

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

Shepard opened this issue Apr 10, 2014 · 0 comments · Fixed by #7309
Assignees
Milestone

Comments

@Shepard
Copy link
Contributor

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: http://jsbin.com/acIRUBo/46/edit
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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants