Skip to content

Commit

Permalink
Merge pull request #7556 from UdaySagar-Git/issues/7552/fix-multi-select
Browse files Browse the repository at this point in the history
Fix: unusual behaviour when removing selected Options
  • Loading branch information
khavinshankar authored Apr 24, 2024
2 parents 55ec1e3 + 183a4a3 commit 130a195
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Components/Form/MultiSelectMenuV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,20 @@ interface MultiSelectOptionChipProps {
onRemove?: () => void;
}

export const MultiSelectOptionChip = (props: MultiSelectOptionChipProps) => {
export const MultiSelectOptionChip = ({
label,
onRemove,
}: MultiSelectOptionChipProps) => {
return (
<span className="flex items-center gap-2 rounded-full border-gray-300 bg-gray-200 px-3 text-xs text-gray-700">
<p className="py-1">{props.label}</p>
{props.onRemove && (
<p className="py-1">{label}</p>
{onRemove && (
<p
className="cursor-pointer rounded-full hover:bg-white"
onClick={props.onRemove}
onClick={(e) => {
e.stopPropagation();
onRemove();
}}
>
<CareIcon icon="l-times" className="text-base" />
</p>
Expand Down

0 comments on commit 130a195

Please sign in to comment.