8000 In multiselect mode, searching then selecting doesn't refresh the display - with solution · Issue #39 · dbrekalo/fastselect · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
In multiselect mode, searching then selecting doesn't refresh the display - with solution #39
Open
@DiMono

Description

@DiMono

If you start typing in a multiselect input, the displayed results are filtered based on your search criteria. This is good!

If you then click on one of the results, the search string disappears, but the results remain filtered, with no visual cue as to what's wrong or how to fix it. This is bad.

It's caused by line 454 of fastselect.js, which is as follows:

451        clear: function() {
452
453            this.hideResults();
454            this.$input.val('').trigger('change');
455
456            return this;
457
458        },

The problem is that there is no listener for the change event! This can be fixed by changing line 454 to

this.$input.val('').trigger('keyup');

This change will cause the input to correctly re-open the results with no filter applied. Of course, you might decide that it's better to let the user choose whether to clear the filter, in which case you'd want to remove that line entirely, but I'm sure that comes down to personal preference. The clear() function is only called under this circumstance, so you will not break anything else by commenting out line 454 if that is your desired behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0