Skip to content

Commit ca2e25b

Browse files
committed
feat: add scroll snap to point one column at the time
1 parent 6a62bce commit ca2e25b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/widgets/kanban-board/ui/board/Board.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export const Board = () => {
6363
</h2>
6464
<Filters />
6565
</div>
66-
<ScrollArea.Viewport className='w-full flex-1 pb-4'>
66+
<ScrollArea.Viewport
67+
className='max-desktop:snap-x max-desktop:snap-proximity w-full flex-1
68+
pb-4'>
6769
<DragAndDropProvider initialColumns={board.columns}>
6870
<ColumnList backgroundURL={backgroundURL} />
6971
<KanbanDragOverlay />

src/widgets/kanban-board/ui/column/ColumnListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const ColumnListItem = ({
2525
return (
2626
<li
2727
className={cn(
28-
'w-[334px] touch-manipulation list-none rounded-lg',
28+
'w-[334px] touch-manipulation snap-center list-none rounded-lg',
2929
isOverlay && 'styled-outline',
3030
isDragging && 'opacity-60 select-none'
3131
)}

0 commit comments

Comments
 (0)