Skip to content

Commit

Permalink
fix ohcnetwork#8815 clear function fixed and aligned arrow button
Browse files Browse the repository at this point in the history
  • Loading branch information
NitinPSingh committed Oct 17, 2024
1 parent 5455e97 commit 8f4abb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/Components/Facility/SpokeFacilityEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export default function SpokeFacilityEditor(props: SpokeFacilityEditorProps) {
showNOptions={8}
selected={selectedFacility}
setSelected={(v) =>
v && !Array.isArray(v) && setSelectedFacility(v)
(v === undefined || (!Array.isArray(v) && v)) &&
setSelectedFacility(v)
}
errors=""
className="w-full"
Expand Down
17 changes: 5 additions & 12 deletions src/Components/Form/AutoCompleteAsync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ const AutoCompleteAsync = (props: Props) => {
/>
{!disabled && (
<ComboboxButton className="absolute inset-y-0 right-0 flex items-center pr-2">
<div className="absolute right-0 top-1 mr-2 flex items-center text-lg text-secondary-900">
<div className="absolute right-0 mr-2 flex items-center text-lg text-secondary-900">
{hasSelection && !loading && !required && (
<div className="tooltip" id="clear-button">
<CareIcon
icon="l-times-circle"
className="mb-[-5px] h-4 w-4 text-secondary-800 transition-colors duration-200 ease-in-out hover:text-secondary-500"
className="h-4 w-4 text-secondary-800 transition-colors duration-200 ease-in-out hover:text-secondary-500"
onClick={(e) => {
e.preventDefault();
onChange(null);
onChange(undefined);
}}
/>
<span className="tooltip-text tooltip-bottom -translate-x-1/2 text-xs">
Expand All @@ -142,16 +142,9 @@ const AutoCompleteAsync = (props: Props) => {
</div>
)}
{loading ? (
<CareIcon
icon="l-spinner"
className="-mb-1.5 animate-spin"
/>
<CareIcon icon="l-spinner" className="animate-spin" />
) : (
<CareIcon
id="dropdown-toggle"
icon="l-angle-down"
className="-mb-1.5"
/>
<CareIcon id="dropdown-toggle" icon="l-angle-down" />
)}
</div>
</ComboboxButton>
Expand Down

0 comments on commit 8f4abb3

Please sign in to comment.