Skip to content

Commit

Permalink
Remove drag feature
Browse files Browse the repository at this point in the history
  • Loading branch information
vineethasok committed Sep 12, 2023
1 parent d875154 commit 8dbe2c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
31 changes: 5 additions & 26 deletions src/components/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ export const MultiSelect = ({

interface TriggerProps extends Omit<HTMLAttributes<HTMLButtonElement>, "id"> {
placeholder?: string;
sortable?: boolean;
}

const BadgeList = styled.div`
Expand All @@ -150,21 +149,10 @@ const BadgeList = styled.div`
`;

const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(
(
{ placeholder = "Select an option", sortable, onClick: onClickProp, ...props },
ref
) => {
const {
disabled,
id,
hasError,
selectedValueNodeProps,
onSelect,
updateSearch,
updateValues,
} = useCombobox();

const draggable = typeof updateValues === "function" && sortable;
({ placeholder = "Select an option", onClick: onClickProp, ...props }, ref) => {
const { disabled, id, hasError, selectedValueNodeProps, onSelect, updateSearch } =
useCombobox();

const onClick = (e: MouseEvent<HTMLButtonElement>) => {
if (typeof onClickProp === "function") {
onClickProp(e);
Expand All @@ -178,12 +166,6 @@ const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(
id={id}
$error={hasError}
disabled={disabled}
cui-select-trigger=""
onDrop={() => {
if (draggable) {
updateValues([]);
}
}}
onClick={onClick}
{...props}
>
Expand Down Expand Up @@ -211,10 +193,7 @@ const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(
} as DismissibleBadge;
}
return (
<div
key={`multi-select-${id}-${index}`}
draggable={draggable}
>
<div key={`multi-select-${id}-${index}`}>
<Badge
size="sm"
state={disabled ? "disabled" : "default"}
Expand Down
1 change: 0 additions & 1 deletion src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(
id={id}
$error={hasError}
disabled={disabled}
cui-select-trigger=""
onClick={onClick}
{...props}
>
Expand Down

0 comments on commit 8dbe2c8

Please sign in to comment.