Skip to content

Commit 87f4a85

Browse files
committed
fix: Populate card details as part of handleDragEnd
#97
1 parent fa2690d commit 87f4a85

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ This is the container component that encapsulates the lanes and cards
9090
| collapsibleLanes | boolean | Make the lanes with cards collapsible. Default: false |
9191
| editable | boolean | Makes the entire board editable. Allow cards to be added or deleted Default: false |
9292
| handleDragStart | function | Callback function triggered when card drag is started: `handleDragStart(cardId, laneId)` |
93-
| handleDragEnd | function | Callback function triggered when card drag ends: `handleDragEnd(cardId, sourceLaneId, targetLaneId, position)` |
93+
| handleDragEnd | function | Callback function triggered when card drag ends: `handleDragEnd(cardId, sourceLaneId, targetLaneId, position, cardDetails)` |
9494
| handleLaneDragStart | function | Callback function triggered when lane drag is started: `handleLaneDragStart(laneId)` |
9595
| handleLaneDragEnd | function | Callback function triggered when lane drag ends: `handleLaneDragEnd(laneId, newPosition)` |
9696
| cardDragClass | string | CSS class to be applied to Card when being dragged |

src/components/Lane.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class Lane extends Component {
138138
cardId: payload.id,
139139
index: addedIndex
140140
})
141-
handleDragEnd && handleDragEnd(payload.id, payload.laneId, laneId, addedIndex)
141+
handleDragEnd && handleDragEnd(payload.id, payload.laneId, laneId, addedIndex, payload)
142142
}
143143
}
144144

stories/DragDrop.story.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ storiesOf('Drag-n-Drop', module)
1717
console.log(`laneId: ${laneId}`)
1818
}
1919

20-
const handleDragEnd = (cardId, sourceLaneId, targetLaneId, position) => {
20+
const handleDragEnd = (cardId, sourceLaneId, targetLaneId, position, card) => {
2121
console.log('drag ended')
2222
console.log(`cardId: ${cardId}`)
2323
console.log(`sourceLaneId: ${sourceLaneId}`)
2424
console.log(`targetLaneId: ${targetLaneId}`)
2525
console.log(`newPosition: ${position}`)
26+
console.log(`cardDetails:`)
27+
console.log(card)
2628
}
2729

2830
const handleLaneDragStart = laneId => {

0 commit comments

Comments
 (0)