Skip to content

Commit

Permalink
fix: Prevent Selection of both Target and Source when a transfer is made
Browse files Browse the repository at this point in the history
  • Loading branch information
Phanindra Sai committed Nov 10, 2024
1 parent 9cb5e0a commit 57d9290
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/lib/picklist/PickList.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const PickList = React.memo(
});
}

onSelectionChange({ originalEvent, value: selectedValue }, 'targetSelection', props.onTargetSelectionChange);
break;

case 'allToTarget':
Expand All @@ -127,6 +128,7 @@ export const PickList = React.memo(
}

selectedValue = [];
onSelectionChange({ originalEvent, value: selectedValue }, 'targetSelection', props.onTargetSelectionChange);

break;

Expand All @@ -140,6 +142,7 @@ export const PickList = React.memo(
});
}

onSelectionChange({ originalEvent, value: selectedValue }, 'sourceSelection', props.onSourceSelectionChange);
break;

case 'allToSource':
Expand All @@ -154,14 +157,13 @@ export const PickList = React.memo(

selectedValue = [];

onSelectionChange({ originalEvent, value: selectedValue }, 'sourceSelection', props.onSourceSelectionChange);
break;

default:
break;
}

onSelectionChange({ originalEvent, value: selectedValue }, 'sourceSelection', props.onSourceSelectionChange);
onSelectionChange({ originalEvent, value: selectedValue }, 'targetSelection', props.onTargetSelectionChange);
handleChange(event, source, target);
};

Expand Down

0 comments on commit 57d9290

Please sign in to comment.