Fixed #2846 - Add resetFilterOnHide property to Dropdown
parent
400cabe01f
commit
a0f9d344a8
|
@ -179,6 +179,12 @@ const DropdownProps = [
|
|||
default: "pi pi-spinner pi-spin",
|
||||
description: "Icon to display in loading state."
|
||||
},
|
||||
{
|
||||
name: "resetFilterOnHide",
|
||||
type: "boolean",
|
||||
default: "false",
|
||||
description: "Clears the filter value when hiding the dropdown."
|
||||
},
|
||||
{
|
||||
name: "virtualScrollerOptions",
|
||||
type: "object",
|
||||
|
|
|
@ -168,6 +168,10 @@ export interface DropdownProps {
|
|||
* Default value is 'pi pi-spinner pi-spin'.
|
||||
*/
|
||||
loadingIcon?: string | 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
|
||||
|
|
|
@ -132,6 +132,10 @@ export default {
|
|||
type: String,
|
||||
default: 'pi pi-spinner pi-spin'
|
||||
},
|
||||
resetFilterOnHide: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
virtualScrollerOptions: {
|
||||
type: Object,
|
||||
default: null
|
||||
|
@ -272,6 +276,7 @@ export default {
|
|||
this.focusedOptionIndex = -1;
|
||||
this.searchValue = '';
|
||||
|
||||
this.resetFilterOnHide && (this.filterValue = null);
|
||||
isFocus && this.$refs.focusInput && this.$refs.focusInput.focus();
|
||||
}
|
||||
|
||||
|
|
|
@ -312,6 +312,12 @@ export default {
|
|||
<td>pi pi-spinner pi-spin</td>
|
||||
<td>Icon to display in loading state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>resetFilterOnHide</td>
|
||||
<td>boolean</td>
|
||||
<td>false</td>
|
||||
<td>Clears the filter value when hiding the dropdown.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>virtualScrollerOptions</td>
|
||||
<td>object</td>
|
||||
|
|
Loading…
Reference in New Issue