diff --git a/src/components/dropdown/Dropdown.d.ts b/src/components/dropdown/Dropdown.d.ts index 17105ce3d..9fbcdb9d3 100755 --- a/src/components/dropdown/Dropdown.d.ts +++ b/src/components/dropdown/Dropdown.d.ts @@ -25,6 +25,7 @@ export declare class Dropdown extends Vue { $emit(eventName: 'before-leave'): this; $emit(eventName: 'show'): this; $emit(eventName: 'hide'): this; + $emit(eventName: 'filter', e: { originalEvent: Event, value: string }): this; $slot: { option: VNode[]; } diff --git a/src/components/dropdown/Dropdown.vue b/src/components/dropdown/Dropdown.vue index cf1b9fcdb..766b48ed4 100755 --- a/src/components/dropdown/Dropdown.vue +++ b/src/components/dropdown/Dropdown.vue @@ -19,7 +19,7 @@
- +
@@ -407,6 +407,9 @@ export default { else document.getElementById(this.appendTo).removeChild(this.$refs.overlay); } + }, + onFilterChange(event) { + this.$emit('filter', {originalEvent: event, value: event.target.value}); } }, computed: { diff --git a/src/components/listbox/Listbox.d.ts b/src/components/listbox/Listbox.d.ts index e50df407f..b53a83b06 100755 --- a/src/components/listbox/Listbox.d.ts +++ b/src/components/listbox/Listbox.d.ts @@ -17,6 +17,7 @@ export declare class Listbox extends Vue { ariaLabelledBy?: string; $emit(eventName: 'input', value: any): this; $emit(eventName: 'change', e: { originalEvent: Event, value: any }): this; + $emit(eventName: 'filter', e: { originalEvent: Event, value: string }): this; $slots: { option: VNode[]; } diff --git a/src/components/listbox/Listbox.vue b/src/components/listbox/Listbox.vue index 6dc940835..9f6bf41da 100755 --- a/src/components/listbox/Listbox.vue +++ b/src/components/listbox/Listbox.vue @@ -2,7 +2,7 @@
- +
@@ -216,6 +216,9 @@ export default { return DomHandler.hasClass(prevItem, 'p-disabled') ? this.findPrevItem(prevItem) : prevItem; else return null; + }, + onFilterChange(event) { + this.$emit('filter', {originalEvent: event, value: event.target.value}); } }, computed: { diff --git a/src/components/multiselect/MultiSelect.d.ts b/src/components/multiselect/MultiSelect.d.ts index 2d4a3d189..5e32fcba1 100755 --- a/src/components/multiselect/MultiSelect.d.ts +++ b/src/components/multiselect/MultiSelect.d.ts @@ -23,6 +23,7 @@ export declare class MultiSelect extends Vue { $emit(eventName: 'before-leave'): this; $emit(eventName: 'show'): this; $emit(eventName: 'hide'): this; + $emit(eventName: 'filter', e: { originalEvent: Event, value: string }): this; $slots: { value: VNode[]; option: VNode[]; diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index 347fc2908..4c249175d 100755 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -26,7 +26,7 @@
- +