fix: boards scrolling with wheel
This commit is contained in:
@ -6,6 +6,7 @@ import Board from "@/app/deals/components/shared/Board/Board";
|
||||
import CreateBoardButton from "@/app/deals/components/shared/CreateBoardButton/CreateBoardButton";
|
||||
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
|
||||
import SortableDnd from "@/components/dnd/SortableDnd";
|
||||
import useHorizontalWheel from "@/hooks/utils/useHorizontalWheel";
|
||||
import useIsMobile from "@/hooks/utils/useIsMobile";
|
||||
import { BoardSchema } from "@/lib/client";
|
||||
import styles from "./Boards.module.css";
|
||||
@ -13,6 +14,7 @@ import styles from "./Boards.module.css";
|
||||
const Boards = () => {
|
||||
const { boards, setSelectedBoardId, boardsCrud } = useBoardsContext();
|
||||
const isMobile = useIsMobile();
|
||||
const { ref, onWheel } = useHorizontalWheel<HTMLDivElement>();
|
||||
|
||||
const renderBoard = (board: BoardSchema) => <Board board={board} />;
|
||||
|
||||
@ -29,6 +31,8 @@ const Boards = () => {
|
||||
align={"end"}
|
||||
className={styles.container}>
|
||||
<ScrollArea
|
||||
viewportRef={ref}
|
||||
onWheel={onWheel}
|
||||
offsetScrollbars={"x"}
|
||||
scrollbars={"x"}
|
||||
scrollbarSize={0}>
|
||||
|
||||
Reference in New Issue
Block a user