Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was 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

Description

@Shepard

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).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions