Skip to content

Commit

Permalink
Fixed #57 - MultiSelect filter cannot be turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Oct 1, 2019
1 parent 8e7c899 commit a8893d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/components/multiselect/MultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<span :class="['p-checkbox-icon p-c', {'pi pi-check': allSelected}]"></span>
</div>
</div>
<div class="p-multiselect-filter-container">
<div v-if="filter" class="p-multiselect-filter-container">
<input type="text" v-model="filterValue" class="p-multiselect-filter p-component p-inputtext p-component" :placeholder="filterPlaceholder">
<span class="p-multiselect-filter-icon pi pi-search"></span>
</div>
Expand Down Expand Up @@ -129,7 +129,7 @@ export default {
this.headerCheckboxFocused = false;
},
onClick() {
if (!this.$refs.overlay || !this.$refs.overlay.contains(event.target)) {
if (!this.disabled && (!this.$refs.overlay || !this.$refs.overlay.contains(event.target))) {
this.overlayVisible = !this.overlayVisible;
this.$refs.focusInput.focus();
}
Expand All @@ -143,7 +143,7 @@ export default {
case 40:
if (this.visibleOptions && !this.overlayVisible && event.altKey) {
this.overlayVisible = true;
}
}
break;
//space
Expand Down Expand Up @@ -190,7 +190,7 @@ export default {
},
onOptionKeyDown(event, option) {
let listItem = event.target;
switch(event.which) {
//down
case 40:
Expand All @@ -201,7 +201,7 @@ export default {
event.preventDefault();
break;
//up
case 38:
var prevItem = this.findPrevItem(listItem);
Expand All @@ -211,7 +211,7 @@ export default {
event.preventDefault();
break;
//enter
case 13:
this.onOptionSelect(event, option);
Expand Down Expand Up @@ -351,7 +351,7 @@ export default {
}
else {
return this.value && this.options && (this.value.length > 0 && this.value.length === this.options.length);
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/multiselect/MultiSelectDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ data() {
<tr>
<td>filter</td>
<td>boolean</td>
<td>true</td>
<td>false</td>
<td>When specified, displays an input field to filter the items on keyup.</td>
</tr>
<tr>
Expand Down

0 comments on commit a8893d6

Please sign in to comment.