Skip to content

Commit 9d4cc34

Browse files
committed
Refactor code
1 parent 742ae7b commit 9d4cc34

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/index.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ export default class extends React.Component {
3636

3737
evt.from.insertBefore(evt.item, store.nextSibling);
3838

39-
if (remote !== this && remote.props.group && remote.props.group.pull === 'clone') {
40-
// Remove the node with the same data-reactid
41-
evt.item.parentNode.removeChild(evt.item);
42-
}
43-
44-
this.props.onChange && this.props.onChange(items, this.sortable);
45-
4639
if (remote !== this) {
40+
if ((typeof remote.props.group === 'object') && (remote.props.group.pull === 'clone')) {
41+
// Remove the node with the same data-reactid
42+
evt.item.parentNode.removeChild(evt.item);
43+
}
44+
4745
remote.props.onChange && remote.props.onChange(remoteItems, remote.sortable);
4846
}
47+
48+
this.props.onChange && this.props.onChange(items, this.sortable);
4949
}
5050

5151
setTimeout(() => {

0 commit comments

Comments
 (0)