From 86774c5a9a336e492ee04eba93f905efacb09710 Mon Sep 17 00:00:00 2001 From: Akshay Antony Date: Thu, 11 Jan 2024 10:38:52 +0530 Subject: [PATCH 1/2] fix: Primefaces#5735, Dropdown: After selecting an option, clearing the value using close icon should clear the filter input --- components/doc/dropdown/filterdoc.js | 1 + components/lib/dropdown/Dropdown.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/components/doc/dropdown/filterdoc.js b/components/doc/dropdown/filterdoc.js index e310013f82..8711ddee9f 100644 --- a/components/doc/dropdown/filterdoc.js +++ b/components/doc/dropdown/filterdoc.js @@ -165,6 +165,7 @@ export default function FilterDemo() { optionLabel="name" placeholder="Select a Country" filter + showClear valueTemplate={selectedCountryTemplate} itemTemplate={countryOptionTemplate} className="w-full md:w-14rem" diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index 75e87941eb..be0071e1c9 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -457,6 +457,10 @@ export const Dropdown = React.memo( } }); } + + if (props.filter) { + resetFilter(); + } updateEditableLabel(); }; From 693cca609573ecdb05fbbe7eb94014ffe2b697a3 Mon Sep 17 00:00:00 2001 From: Akshay Antony Date: Thu, 11 Jan 2024 10:43:34 +0530 Subject: [PATCH 2/2] fix: Primefaces#5735, Dropdown: After selecting an option, clearing the value using close icon should clear the filter input --- components/lib/dropdown/Dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index be0071e1c9..bb42a54dcb 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -457,7 +457,7 @@ export const Dropdown = React.memo( } }); } - + if (props.filter) { resetFilter(); }