Skip to content

Commit 77f5633

Browse files
authored
backward compatibility
handleDragEnd receives updated card object, updated to keep it as it was
1 parent 64a29b0 commit 77f5633

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/Lane.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
33
import {bindActionCreators} from 'redux'
44
import {connect} from 'react-redux'
55
import isEqual from 'lodash/isEqual'
6+
import cloneDeep from 'lodash/cloneDeep'
67
import Container from '../dnd/Container'
78
import Draggable from '../dnd/Draggable'
89
import uuidv1 from 'uuid/v1'
@@ -139,7 +140,8 @@ class Lane extends Component {
139140
const {handleDragEnd} = this.props
140141
const {addedIndex, payload} = result
141142
if (addedIndex != null) {
142-
const response = handleDragEnd ? handleDragEnd(payload.id, payload.laneId, laneId, addedIndex, payload) : true
143+
const newCard = {...cloneDeep(payload), laneId}
144+
const response = handleDragEnd ? handleDragEnd(payload.id, payload.laneId, laneId, addedIndex, newCard) : true
143145
if (response === undefined || !!response) {
144146
this.props.actions.moveCardAcrossLanes({
145147
fromLaneId: payload.laneId,

0 commit comments

Comments
 (0)