Skip to content

Commit 6172047

Browse files
authored
fix: expand kanban column drop zone to full height (#18897)
## Summary - Added `flex: 1` to `StyledColumnContainer` in `RecordBoardColumns.tsx` - The column wrapper wasn't stretching vertically, so the droppable area only covered the top of each column where cards existed - Now the entire column height is a valid drop target ## Test plan - [ ] Open a board/kanban view - [ ] Drag a card from one column - [ ] Drop it in the lower/empty area of another column - [ ] Verify the drop registers correctly Fixes #18842
1 parent 31baf52 commit 6172047

3 files changed

Lines changed: 9 additions & 14 deletions

File tree

packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardColumns.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { themeCssVariables } from 'twenty-ui/theme-constants';
77

88
const StyledColumnContainer = styled.div`
99
display: flex;
10+
flex: 1;
1011
1112
& > *:not(:first-of-type) {
1213
border-left: 1px solid ${themeCssVariables.border.color.light};

packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumn.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ import { isDefined } from 'twenty-shared/utils';
1515
const StyledColumn = styled.div`
1616
background-color: ${themeCssVariables.background.primary};
1717
display: flex;
18-
flex: 1;
1918
flex-direction: column;
20-
height: 100%;
2119
max-width: 200px;
22-
min-height: 100%;
2320
min-width: 200px;
2421
padding: ${themeCssVariables.spacing[2]};
2522
padding-top: 0px;
@@ -63,14 +60,17 @@ export const RecordBoardColumn = ({
6360
columnIndex: recordBoardColumnIndex,
6461
}}
6562
>
66-
<Droppable droppableId={recordBoardColumnId}>
63+
<Droppable droppableId={recordBoardColumnId} ignoreContainerClipping>
6764
{(droppableProvided) => (
68-
<StyledColumn>
65+
<StyledColumn
66+
ref={droppableProvided.innerRef}
67+
// oxlint-disable-next-line react/jsx-props-no-spreading
68+
{...droppableProvided.droppableProps}
69+
>
6970
<DragAndDropLibraryLegacyReRenderBreaker
7071
memoizationId={recordBoardColumnId}
7172
>
7273
<RecordBoardColumnCardsContainer
73-
droppableProvided={droppableProvided}
7474
recordBoardColumnId={recordBoardColumnId}
7575
/>
7676
</DragAndDropLibraryLegacyReRenderBreaker>

packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnCardsContainer.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Draggable, type DroppableProvided } from '@hello-pangea/dnd';
1+
import { Draggable } from '@hello-pangea/dnd';
22
import { styled } from '@linaria/react';
33
import { useContext } from 'react';
44
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -25,12 +25,10 @@ const StyledNewButtonContainer = styled.div`
2525

2626
type RecordBoardColumnCardsContainerProps = {
2727
recordBoardColumnId: string;
28-
droppableProvided: DroppableProvided;
2928
};
3029

3130
export const RecordBoardColumnCardsContainer = ({
3231
recordBoardColumnId,
33-
droppableProvided,
3432
}: RecordBoardColumnCardsContainerProps) => {
3533
const { columnDefinition } = useContext(RecordBoardColumnContext);
3634

@@ -45,11 +43,7 @@ export const RecordBoardColumnCardsContainer = ({
4543
);
4644

4745
return (
48-
<StyledColumnCardsContainer
49-
ref={droppableProvided?.innerRef}
50-
// oxlint-disable-next-line react/jsx-props-no-spreading
51-
{...droppableProvided?.droppableProps}
52-
>
46+
<StyledColumnCardsContainer>
5347
{recordIndexRecordIdsByGroup.map((recordId, index) => (
5448
<RecordBoardCardDraggableContainer
5549
key={recordId}

0 commit comments

Comments
 (0)