From a0e6e621260a3501e3828c3ad9f14ae7efd3d94f Mon Sep 17 00:00:00 2001 From: NitinPSingh <71833171+NitinPSingh@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:50:34 +0530 Subject: [PATCH] Fix#8815 fixed clear button functionaly and center aligned arrow dropdown arrow (#8895) --- src/components/Facility/SpokeFacilityEditor.tsx | 5 +++-- src/components/Form/AutoCompleteAsync.tsx | 17 +++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/components/Facility/SpokeFacilityEditor.tsx b/src/components/Facility/SpokeFacilityEditor.tsx index a6dfe9e00aa..bf07ec4e9bb 100644 --- a/src/components/Facility/SpokeFacilityEditor.tsx +++ b/src/components/Facility/SpokeFacilityEditor.tsx @@ -78,7 +78,8 @@ export default function SpokeFacilityEditor(props: SpokeFacilityEditorProps) { setItem: (item: FacilitySpokeModel | FacilitySpokeRequest) => void, processing: boolean, ) => { - const [selectedFacility, setSelectedFacility] = useState(); + const [selectedFacility, setSelectedFacility] = + useState(null); useEffect(() => { setItem({ ...item, spoke: selectedFacility?.id }); @@ -99,7 +100,7 @@ export default function SpokeFacilityEditor(props: SpokeFacilityEditorProps) { showNOptions={8} selected={selectedFacility} setSelected={(v) => - v && !Array.isArray(v) && setSelectedFacility(v) + (v === null || !Array.isArray(v)) && setSelectedFacility(v) } errors="" className="w-full" diff --git a/src/components/Form/AutoCompleteAsync.tsx b/src/components/Form/AutoCompleteAsync.tsx index ddec1503042..839a74c880c 100644 --- a/src/components/Form/AutoCompleteAsync.tsx +++ b/src/components/Form/AutoCompleteAsync.tsx @@ -100,7 +100,7 @@ const AutoCompleteAsync = (props: Props) => { immediate >
-
+
{ /> {!disabled && ( -
+
{hasSelection && !loading && !required && (
{ e.preventDefault(); onChange(null); @@ -142,16 +142,9 @@ const AutoCompleteAsync = (props: Props) => {
)} {loading ? ( - + ) : ( - + )}