Skip to content

Commit

Permalink
fix: multi select scroll (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
uubulb authored Dec 9, 2024
1 parent c01a48c commit baf611e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/xui/multi-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ export const MultiSelect = React.forwardRef<
}
};

const stopWheelEventPropagation: React.WheelEventHandler = (e) => {
e.stopPropagation();
};

const stopTouchMoveEventPropagation: React.TouchEventHandler = (e) => {
e.stopPropagation();
};

return (
<Popover
open={isPopoverOpen}
Expand Down Expand Up @@ -306,6 +314,8 @@ export const MultiSelect = React.forwardRef<
className="w-auto p-0"
align="start"
onEscapeKeyDown={() => setIsPopoverOpen(false)}
onWheel={stopWheelEventPropagation}
onTouchMove={stopTouchMoveEventPropagation}
>
<Command>
<CommandInput
Expand Down

0 comments on commit baf611e

Please sign in to comment.