diff --git a/api-generator/components/multiselect.js b/api-generator/components/multiselect.js index a21205705..0ee9aa57e 100644 --- a/api-generator/components/multiselect.js +++ b/api-generator/components/multiselect.js @@ -179,12 +179,18 @@ const MultiSelectProps = [ default: "false", description: "Whether all data is selected." }, + { + name: "resetFilterOnHide", + type: "boolean", + default: "false", + description: "Clears the filter value when hiding the dropdown." + }, { name: "virtualScrollerOptions", type: "object", default: "null", description: "Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it." - } + }, ]; const MultiSelectEvents = [ diff --git a/src/components/multiselect/MultiSelect.d.ts b/src/components/multiselect/MultiSelect.d.ts index 8895a3d0e..f6d77c35c 100755 --- a/src/components/multiselect/MultiSelect.d.ts +++ b/src/components/multiselect/MultiSelect.d.ts @@ -182,15 +182,19 @@ export interface MultiSelectProps { * Default value is 'pi pi-spinner pi-spin'. */ loadingIcon?: string | undefined; + /** + * Whether all data is selected. + */ + selectAll?: boolean | undefined; + /** + * Clears the filter value when hiding the dropdown. + */ + resetFilterOnHide?: boolean; /** * Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it. * @see VirtualScroller.VirtualScrollerProps */ virtualScrollerOptions?: VirtualScrollerProps; - /** - * Whether all data is selected. - */ - selectAll?: boolean | undefined; } export interface MultiSelectSlots { diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index d970b019c..c441e3478 100755 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -184,16 +184,16 @@ export default { type: String, default: 'pi pi-spinner pi-spin' }, - virtualScrollerOptions: { - type: Object, - default: null - }, selectAll: { type: Boolean, default: null }, - clearFilterOnHide: { + resetFilterOnHide: { type: Boolean, + default: false + }, + virtualScrollerOptions: { + type: Object, default: null } }, @@ -290,7 +290,7 @@ export default { hide() { this.$emit('before-hide'); this.overlayVisible = false; - if (this.clearFilterOnHide) { + if (this.resetFilterOnHide) { this.filterValue = null; } }, diff --git a/src/views/multiselect/MultiSelectDemo.vue b/src/views/multiselect/MultiSelectDemo.vue index a68f522b5..7979cfc70 100755 --- a/src/views/multiselect/MultiSelectDemo.vue +++ b/src/views/multiselect/MultiSelectDemo.vue @@ -27,7 +27,7 @@