Skip to content

Commit bc11f13

Browse files
committed
Return id, not position
1 parent 90b7bbe commit bc11f13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ class SortablePane extends Component {
315315
lastPressed: pos,
316316
});
317317
this.props.children[pos].props.onDragStart();
318-
this.props.onDragStart(pos);
318+
this.props.onDragStart(this.props.children[pos].props.id);
319319
}
320320

321321
handleMouseMove({ pageX, pageY }) {
@@ -345,7 +345,8 @@ class SortablePane extends Component {
345345
handleMouseUp() {
346346
this.setState({ isPressed: false, delta: 0 });
347347
this.props.children[this.state.lastPressed].props.onDragEnd();
348-
this.props.onDragEnd(this.state.lastPressed);
348+
const lastPressedId = this.props.children[this.state.lastPressed].props.id;
349+
this.props.onDragEnd(lastPressedId);
349350
}
350351

351352
renderPanes() {

0 commit comments

Comments
 (0)