Skip to content

Commit e9c52bf

Browse files
committed
fix: Allow lanes and cards to be dropped in their respective container groups
#30
1 parent 631c248 commit e9c52bf

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

.storybook/preview-head.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<style type="text/css">
2+
body {
3+
font: 14px/18px 'Helvetica Neue', Arial, Helvetica, sans-serif;
4+
}
5+
</style>

src/components/Lane.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ class Lane extends Component {
128128
handleDragStart && handleDragStart(payload.id, payload.laneId)
129129
}
130130

131+
shouldAcceptDrop = (sourceContainerOptions) => {
132+
return this.props.droppable && sourceContainerOptions.groupName === 'TrelloLane'
133+
}
134+
131135
onDragEnd = (laneId, result) => {
132136
const {handleDragEnd} = this.props
133137
const {addedIndex, payload} = result
@@ -150,7 +154,6 @@ class Lane extends Component {
150154
tagStyle,
151155
cardStyle,
152156
draggable,
153-
droppable,
154157
cards,
155158
id
156159
} = this.props
@@ -181,12 +184,13 @@ class Lane extends Component {
181184
return (
182185
<ScrollableLane innerRef={this.laneDidMount} isDraggingOver={isDraggingOver}>
183186
<Container
187+
orientation="vertical"
184188
groupName="TrelloLane"
185189
onDragStart={this.onDragStart}
186190
onDrop={e => this.onDragEnd(id, e)}
187191
onDragEnter={() => this.setState({isDraggingOver: true})}
188192
onDragLeave={() => this.setState({isDraggingOver: false})}
189-
shouldAcceptDrop={() => droppable}
193+
shouldAcceptDrop={this.shouldAcceptDrop}
190194
getChildPayload={index => this.props.getCardDetails(id, index)}>
191195
{cardList}
192196
</Container>

src/styles/Base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const BoardDiv = styled.div`
1717
background-color: #23719f;
1818
overflow-y: hidden;
1919
padding: 5px;
20-
font: 14px/18px 'Helvetica Neue', Arial, Helvetica, sans-serif;
2120
color: #393939;
2221
display: flex;
2322
flex-direction: row;
@@ -120,6 +119,7 @@ export const CardRightContent = styled(RightContent)`
120119
export const Detail = styled.div`
121120
font-size: 12px;
122121
color: #4d4d4d;
122+
white-space: normal;
123123
`
124124

125125
export const Footer = styled.div`

stories/BoardStyling.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ const data = require('./data/base.json')
1111
storiesOf('Advanced Features', module).add(
1212
'Board Styling',
1313
withInfo('Change the background and other css styles for the board container')(() =>
14-
<Board data={data} style={{padding: '30px 20px'}} className='boardContainer' />
14+
<Board data={data} style={{padding: '30px 20px', fontFamily: 'Verdana'}} className='boardContainer' />
1515
)
1616
)

stories/data/drag-drop.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@
4646
]
4747
},
4848
{
49-
"id": "BLOCKED",
50-
"title": "Blocked (Droppable)",
49+
"id": "COMPLETED",
50+
"title": "Completed (Droppable)",
5151
"label": "0/0",
52+
"style": {"width": 280},
5253
"cards": []
5354
}
5455
]

0 commit comments

Comments
 (0)