@@ -49,15 +49,23 @@ class BoardContainer extends Component {
4949 }
5050 }
5151
52+ onDragStart = card => {
53+ const { handleDragStart} = this . props
54+ handleDragStart ( card . draggableId , card . source . droppableId )
55+ }
56+
5257 onDragEnd = result => {
58+ const { handleDragEnd} = this . props
5359 const { source, destination, draggableId} = result
54- destination &&
55- this . props . actions . moveCardAcrossLanes ( {
56- fromLaneId : source . droppableId ,
57- toLaneId : destination . droppableId ,
58- cardId : draggableId ,
59- index : destination . index
60- } )
60+ if ( destination ) {
61+ this . props . actions . moveCardAcrossLanes ( {
62+ fromLaneId : source . droppableId ,
63+ toLaneId : destination . droppableId ,
64+ cardId : draggableId ,
65+ index : destination . index
66+ } )
67+ handleDragEnd ( draggableId , source . droppableId , destination . droppableId , destination . index )
68+ }
6169 }
6270
6371 render ( ) {
@@ -73,8 +81,6 @@ class BoardContainer extends Component {
7381 'laneSortFunction' ,
7482 'draggable' ,
7583 'editable' ,
76- 'handleDragStart' ,
77- 'handleDragEnd' ,
7884 'customCardLayout' ,
7985 'newCardTemplate' ,
8086 'customLaneHeader' ,
@@ -83,7 +89,7 @@ class BoardContainer extends Component {
8389 ] )
8490
8591 return (
86- < DragDropContext onDragEnd = { this . onDragEnd } >
92+ < DragDropContext onDragStart = { this . onDragStart } onDragEnd = { this . onDragEnd } >
8793 < BoardDiv style = { style } { ...otherProps } >
8894 { reducerData . lanes . map ( ( lane , index ) => {
8995 const { id, droppable, ...otherProps } = lane
@@ -130,6 +136,8 @@ BoardContainer.propTypes = {
130136
131137BoardContainer . defaultProps = {
132138 onDataChange : ( ) => { } ,
139+ handleDragStart : ( ) => { } ,
140+ handleDragEnd : ( ) => { } ,
133141 editable : false ,
134142 draggable : false
135143}
0 commit comments