Skip to content

Commit d61d284

Browse files
author
Damian Dulisz
committed
Fix for not displaying highlight labels. Also shentao#79
1 parent d91c8ed commit d61d284

File tree

12 files changed

+58
-12
lines changed

12 files changed

+58
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# vue-multiselect ![Build Status](https://circleci.com/gh/monterail/vue-multiselect/tree/master.svg?style=shield&circle-token=5c931ff28fd12587610f835472becdd514d09cef)
22
Probably the most complete *selecting* solution for Vue.js, without jQuery.
33

4-
#### Current version: v1.1.0
4+
#### Current version: v1.1.2
55

66
### Features & characteristics:
77
* NO dependencies

docs/partials/_start.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ section.start(
55
h1.typo__h1
66
img.logo(src="./static/vue-logo.png")
77
| Vue-multiselect
8-
small.version (v1.1.0)
8+
small.version (v1.1.2)
99
h3.typo__h3 The most complete selecting solution for
1010
= ' '
1111
a.typo__link(href="http://vuejs.org" target="_BLANK") Vue.js

docs/partials/api/_props.jade

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ h2.typo__h2#props Props
5959
td.table__td: kbd true
6060
td.table__td
6161
| Add / removes search input.
62+
tr.table__tr
63+
td.table__td: strong LocalSearch
64+
td.table__td Boolean
65+
td.table__td: kbd true
66+
td.table__td
67+
| Decide whether to filter the results based on search query. Useful for async filtering, where we search through more complex data.
6268
tr.table__tr
6369
td.table__td: strong ClearOnSelect
6470
td.table__td Boolean

docs/partials/examples/_ajax-search.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ p.typo__p
1111
:options="countries",
1212
:selected="selectedCountries",
1313
:multiple="multiple",
14-
:searchable="searchable",
14+
:local-search="false",
1515
:clear-on-select="false",
1616
:close-on-select="false",
1717
:loading="isLoading",
@@ -36,7 +36,7 @@ p.typo__p
3636
:options="countries",
3737
:selected="selectedCountries",
3838
:multiple="multiple",
39-
:searchable="searchable",
39+
:local-search="false",
4040
:clear-on-select="false",
4141
:close-on-select="false",
4242
:loading="isLoading",

lib/Multiselect.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@
7171
track-by="$index"
7272
tabindex="0"
7373
:class="{ 'multiselect__option--highlight': $index === pointer && this.showPointer, 'multiselect__option--selected': !isNotSelected(option) }"
74+
class="multiselect__option"
7475
@mousedown.prevent="select(option)"
7576
@mouseenter="pointerSet($index)"
76-
class="multiselect__option">
77+
:data-select="option.isTag ? tagPlaceholder : selectLabel"
78+
:data-selected="selectedLabel"
79+
:data-deselect="deselectLabel">
7780
<partial :name="optionPartial" v-if="optionPartial.length"></partial>
7881
<span v-else v-text="getOptionLabel(option)"></span>
7982
</li>

lib/multiselectMixin.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ module.exports = {
99
}
1010
},
1111
props: {
12+
/**
13+
* Decide whether to filter the results based on search query.
14+
* Useful for async filtering, where we search through more complex data.
15+
* @type {Boolean}
16+
*/
17+
localSearch: {
18+
type: Boolean,
19+
default: true
20+
},
1221
/**
1322
* Array of available options: Objects, Strings or Integers.
1423
* If array of objects, visible label will default to option.label.
@@ -180,7 +189,7 @@ module.exports = {
180189
let options = this.hideSelected
181190
? this.options.filter(this.isNotSelected)
182191
: this.options
183-
options = this.$options.filters.filterBy(options, this.search)
192+
if (this.localSearch) options = this.$options.filters.filterBy(options, this.search)
184193
if (this.taggable && search.length && !this.isExistingOption(search)) {
185194
options.unshift({ isTag: true, label: search })
186195
}

lib/vue-multiselect.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/vue-multiselect.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-multiselect",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Multiselect component for vue.js",
55
"author": "Damian Dulisz <damian.dulisz@monterail.com>",
66
"private": false,

src/Multiselect.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@
7171
track-by="$index"
7272
tabindex="0"
7373
:class="{ 'multiselect__option--highlight': $index === pointer && this.showPointer, 'multiselect__option--selected': !isNotSelected(option) }"
74+
class="multiselect__option"
7475
@mousedown.prevent="select(option)"
7576
@mouseenter="pointerSet($index)"
76-
class="multiselect__option">
77+
:data-select="option.isTag ? tagPlaceholder : selectLabel"
78+
:data-selected="selectedLabel"
79+
:data-deselect="deselectLabel">
7780
<partial :name="optionPartial" v-if="optionPartial.length"></partial>
7881
<span v-else v-text="getOptionLabel(option)"></span>
7982
</li>

0 commit comments

Comments
 (0)