Skip to content

Commit

Permalink
fix(client): Fix combobox state in location panel
Browse files Browse the repository at this point in the history
The second combobox of the administrative tab could be enabled even if no selection was made in the first.
  • Loading branch information
clementprdhomme committed Nov 28, 2024
1 parent 5528674 commit c2dbe0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/components/panels/location/administrative-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AdministrativeTab = ({ locationCode, onChangeLocationCode }: Administrativ
"administrative",
2,
locationCode[0],
locationCode.length > 0,
locationCode.length > 0 && locationCode[0] !== "SS",
);
const { data: dataLevel3, isLoading: isLoadingLevel3 } = useLocationsByType(
"administrative",
Expand Down Expand Up @@ -126,7 +126,7 @@ const AdministrativeTab = ({ locationCode, onChangeLocationCode }: Administrativ
</Combobox>
<Combobox value={locationCode?.[1] ?? ""} onValueChange={onChangeLocationLevel2}>
<div className="relative">
<ComboboxTrigger disabled={locationCode.length < 1}>
<ComboboxTrigger disabled={locationCode.length < 1 || locationCode[0] === "SS"}>
{!!selectedLocationLevel2 && (
<span className="font-semibold">{selectedLocationLevel2.name}</span>
)}
Expand Down

0 comments on commit c2dbe0d

Please sign in to comment.