Skip to content

Commit

Permalink
remove on mouse scroll card movment
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaBhattacharjee committed Apr 10, 2024
1 parent 50cf49c commit 8e30d67
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion public/sw.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions src/components/shared/cards/Cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,6 @@ const Cards: React.FC<CardsProps> = ({ props }) => {
}
};

useEffect(() => {
const handleWheel = (event: WheelEvent) => {
if (containerRef.current?.contains(event.target as Node)) {
event.preventDefault();
containerRef.current!.scrollLeft += event.deltaY;
}
};

containerRef?.current?.addEventListener("wheel", handleWheel, { passive: false });
return () => {
containerRef?.current?.removeEventListener("wheel", handleWheel);
};
}, []);
const container = {
hidden: { opacity: 1, scale: 0 },
visible: {
Expand Down

0 comments on commit 8e30d67

Please sign in to comment.