Skip to content

Commit

Permalink
1170 - Wrong district name displayed on the dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Brijesh committed Nov 4, 2024
1 parent b8d5ba2 commit 4a0c07e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/selectRangeUsePlanPage/ZoneSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ export function ZoneSelectAll({ zones, users, zoneInfo, setZoneInfo }) {
onClick={handleChange}
value={zoneInfo?.selectedZones}
multiple
renderValue={(zoneIds) => zoneIds.map((id) => zones[id]?.description).join(', ')}
renderValue={(zoneIds) => {
if (zoneInfo.selectAllZones) return '';
return zoneIds.map((id) => zones.find((zone) => zone.id === id)?.description).join(', ');
}}
MenuProps={{
getContentAnchorEl: () => null,
...MenuProps,
Expand Down Expand Up @@ -249,7 +252,10 @@ export function ZoneSelect({ zones, unassignedZones, userZones, users, setZoneIn
onClick={handleChange}
value={zoneInfo.selectedZones}
multiple
renderValue={(zoneIds) => zoneIds.map((id) => zones[id]?.description).join(', ')}
renderValue={(zoneIds) => {
if (zoneInfo.selectAllZones) return '';
return zoneIds.map((id) => zones.find((zone) => zone.id === id).description).join(', ');
}}
MenuProps={{
getContentAnchorEl: () => null,
...MenuProps,
Expand All @@ -262,7 +268,6 @@ export function ZoneSelect({ zones, unassignedZones, userZones, users, setZoneIn
{userZones &&
userZones.map((zone) => {
const user = users.find((user) => user.id === zone.userId);

return (
<MenuItem
alignItems="flex-start"
Expand Down

0 comments on commit 4a0c07e

Please sign in to comment.