Vue-multiselect: Searching and value selection

Created on 14 Sep 2016  路  10Comments  路  Source: shentao/vue-multiselect

I have two questions for integration into my app.

1. Searching

How can I make search case-insesitive? I have mostly custom label option setup which sets my label like

    formatLabel (val) {
      if (this.customLabel) {
        return obsKeysToString(val, this.customLabel, ' - ')
      } else {
        return val[this.label]
      }
    }

In this case I can add multiple keys from options object to display as a label. Works perectly, but search only works on the key I pass trough label prop and it's case-sensitive...

2. Value selection

When I select an option it returns me entire selected object from options. Is there a way to return a specific key - value from this selected object?

Thanks a lot!

2.0 bug wontfix

Most helpful comment

I will try to release the case-insensitive version today as it鈥檚 already done. Just need to bundle and publish it.

All 10 comments

This is I guess a problem in the 2.0 beta release. I will work on it after I finish the next 1.2 release.

Ok thanks, good to know. Great work so far 馃憤

@shentao I know you are probably very busy and everything but I was wondering if you have any idea when this update will be part of 2.0?

I will try to release the case-insensitive version today as it鈥檚 already done. Just need to bundle and publish it.

I need to pay you for a beer 馃憤

The search is now case insensitive in the newest beta release. You can now also apply customLabels to non-objects options. Still, the search is based on the label/option value for primitives.

I will let you know when I move forward with searching using the custom labels.

This is great and I'm not complaining about anything... but while you are on this subject, you might consider the same for special accented characters evaluating as the same as normal English characters. This comes up for things like search fields for French names and some city names. There is probably a PHP library function which handles this easily.

I haven't researched it much, it just comes to mind and I'm passing by.

@SirLamer No problem at all 馃槃
There is already a PR for this #84. Take a look and let me know if this would solve the problems or if there is something missing.
I will try to find some time to today finally to merge it and write tests for it.

  1. Value selection

When I select an option it returns me entire selected object from options. Is there a way to return a specific key - value from this selected object?

Yeah, I've had to write some extra computed properties to work around this which isn't ideal. It would be helpful if we could define the returned value from the object similar to how we define the track-by and label. (Although at first I expected the track-by to return the value, but it makes sense why it shouldn't).

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

volkanciloglu picture volkanciloglu  路  3Comments

yaakovp picture yaakovp  路  3Comments

xereda picture xereda  路  4Comments

dmitov picture dmitov  路  4Comments

katranci picture katranci  路  3Comments