Vue-select: Stop v-select from filtering AJAX result?

Created on 18 Jun 2017  路  5Comments  路  Source: sagalbot/vue-select

I'm using :on-change callback and I search serverside and return new options. However nothing is shown because I suspect v-select does it's own client side filtering.

Can this be disabled?

enhancement

Most helpful comment

You can use <v-select :filterable="false"> to prevent client side filtering.

All 5 comments

I'm also very interesting in this behaviour.

So after looking into the code it seems that it does a filtering for the options in this section of the code.
filteredOptions() { let options = this.mutableOptions.filter((option) => { if (typeof option === 'object' && option.hasOwnProperty(this.label)) { return option[this.label].toLowerCase().indexOf(this.search.toLowerCase()) > -1 } .........

if a boolean prop can be added to prevent this that would be great like
/** * Disable the option filtering. * @type {Boolean} */ noFilter: { type: Boolean, default: false },

Then the upper code would have to check on that first
filteredOptions() { let options = this.mutableOptions.filter((option) => { if(this.noFilter) { return true; } else if (typeof option === 'object' && option.hasOwnProperty(this.label)) { return option[this.label].toLowerCase().indexOf(this.search.toLowerCase()) > -1 } .........

I am also experiencing the same problem. The server returns a response but nothing is shown because the results are filtered. This makes it impossible to e.g. perform a SQL search based on multiple keywords.

Will be solved by PR #191.

You can use <v-select :filterable="false"> to prevent client side filtering.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ducdev picture ducdev  路  3Comments

pud1m picture pud1m  路  3Comments

manjunath-coachthem picture manjunath-coachthem  路  3Comments

PrimozRome picture PrimozRome  路  4Comments

mattWalters0 picture mattWalters0  路  3Comments