Skip to content

Commit 5716552

Browse files
committed
fix: Move laneprops to the end of Lane to take precedence over drag props
#56
1 parent 63bc2fb commit 5716552

4 files changed

Lines changed: 5 additions & 16 deletions

File tree

src/components/BoardContainer.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,7 @@ class BoardContainer extends Component {
4949
}
5050
}
5151

52-
onDragStart = initial => {
53-
console.log('onDragStart')
54-
console.log(initial)
55-
}
56-
5752
onDragEnd = result => {
58-
console.log('onDragEnd')
59-
console.log(result)
6053
const {source, destination, draggableId} = result
6154
destination && this.props.actions.moveCardAcrossLanes({fromLaneId: source.droppableId, toLaneId: destination.droppableId, cardId: draggableId, index: destination.index})
6255
}
@@ -84,7 +77,7 @@ class BoardContainer extends Component {
8477
])
8578

8679
return (
87-
<DragDropContext onDragStart={this.onDragStart} onDragEnd={this.onDragEnd}>
80+
<DragDropContext onDragEnd={this.onDragEnd}>
8881
<BoardDiv style={style} {...otherProps}>
8982
{reducerData.lanes.map((lane, index) => {
9083
const {id, droppable, ...otherProps} = lane

src/components/Card.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ class Card extends Component {
4949
<MovableCardWrapper
5050
key={id}
5151
data-id={id}
52-
{...otherProps}
5352
innerRef={dragProvided.innerRef}
5453
{...dragProvided.draggableProps}
5554
{...dragProvided.dragHandleProps}
5655
style={{
5756
...style,
5857
...dragStyle
59-
}}>
58+
}}
59+
{...otherProps}
60+
>
6061
{this.renderBody()}
6162
{editable && <DeleteButton onClick={this.removeCard} />}
6263
</MovableCardWrapper>

src/components/Lane.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ class Lane extends Component {
142142
}
143143
}
144144

145-
onDragEnd = result => {
146-
console.log('onDragEnd')
147-
console.log(result)
148-
}
149-
150145
renderDragContainer = () => {
151146
const {laneSortFunction, editable, tagStyle, cardStyle, draggable} = this.props
152147
const {addCardMode} = this.state

stories/Interactions.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ storiesOf('Advanced Features', module).add(
2828
'Event Handling',
2929
withInfo('Adding event handlers to cards')(() =>
3030
<Board
31-
draggable={true}
31+
draggable
3232
data={data}
3333
onCardClick={(cardId, metadata, laneId) => alert(`Card with id:${cardId} clicked. Has metadata.id: ${metadata.id}. Card in lane: ${laneId}`)}
3434
onLaneClick={(laneId) => alert(`Lane with id:${laneId} clicked`)}

0 commit comments

Comments
 (0)