mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
fix: Primefaces#5060, Dropdown: After selecting an option, clearing the value using close icon should clear the filter input (#5061)
* fix: Primefaces#5060, Dropdown: After selecting an option, clearing the value using close icon should clear the filter input * fix: Primefaces#5060, Dropdown: After selecting an option, clearing the value using close icon should clear the filter input --------- Co-authored-by: Akshay Antony <akshayantony55@gmail.com>
This commit is contained in:
parent
6b75f1a565
commit
6f71f8195e
6 changed files with 25 additions and 1 deletions
|
@ -106,6 +106,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
resetFilterOnClear: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
virtualScrollerOptions: {
|
||||
type: Object,
|
||||
default: null
|
||||
|
|
5
components/lib/dropdown/Dropdown.d.ts
vendored
5
components/lib/dropdown/Dropdown.d.ts
vendored
|
@ -389,6 +389,11 @@ export interface DropdownProps {
|
|||
* @defaultValue false
|
||||
*/
|
||||
resetFilterOnHide?: boolean;
|
||||
/**
|
||||
* Clears the filter value when clicking on the clear icon.
|
||||
* @defaultValue false
|
||||
*/
|
||||
resetFilterOnClear?: boolean;
|
||||
/**
|
||||
* Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it.
|
||||
*/
|
||||
|
|
|
@ -421,6 +421,7 @@ export default {
|
|||
},
|
||||
onClearClick(event) {
|
||||
this.updateModel(event, null);
|
||||
this.resetFilterOnClear && (this.filterValue = null);
|
||||
},
|
||||
onFirstHiddenFocus(event) {
|
||||
const focusableEl = event.relatedTarget === this.$refs.focusInput ? DomHandler.getFirstFocusableElement(this.overlay, ':not([data-p-hidden-focusable="true"])') : this.$refs.focusInput;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue