Skip to content

Commit

Permalink
test fail fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NitinPSingh committed Oct 18, 2024
1 parent c5a43f2 commit 291615e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Components/Facility/SpokeFacilityEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export default function SpokeFacilityEditor(props: SpokeFacilityEditorProps) {
setItem: (item: FacilitySpokeModel | FacilitySpokeRequest) => void,
processing: boolean,
) => {
const [selectedFacility, setSelectedFacility] = useState<FacilityModel>();
const [selectedFacility, setSelectedFacility] =
useState<FacilityModel | null>(null);

useEffect(() => {
setItem({ ...item, spoke: selectedFacility?.id });
Expand All @@ -99,8 +100,7 @@ export default function SpokeFacilityEditor(props: SpokeFacilityEditorProps) {
showNOptions={8}
selected={selectedFacility}
setSelected={(v) =>
(v === undefined || (!Array.isArray(v) && v)) &&
setSelectedFacility(v)
(v === null || (!Array.isArray(v) && v)) && setSelectedFacility(v)
}
errors=""
className="w-full"
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Form/AutoCompleteAsync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ const AutoCompleteAsync = (props: Props) => {
return (
<div className={className}>
<Combobox
value={selected?.length > 0 ? selected : null}
value={selected}
disabled={disabled}
onChange={onChange}
by={compareBy}
multiple={multiple as any}
immediate
>
<div className="relative mt-1">
<div className="flex">
<div className="relative flex">
<ComboboxInput
id={id}
name={name}
Expand Down Expand Up @@ -133,7 +133,7 @@ const AutoCompleteAsync = (props: Props) => {
className="h-4 w-4 text-secondary-800 transition-colors duration-200 ease-in-out hover:text-secondary-500"
onClick={(e) => {
e.preventDefault();
onChange(undefined);
onChange(null);
}}
/>
<span className="tooltip-text tooltip-bottom -translate-x-1/2 text-xs">
Expand Down

0 comments on commit 291615e

Please sign in to comment.