Skip to content

Commit

Permalink
Merge pull request SortableJS#595 from slavicd/master
Browse files Browse the repository at this point in the history
Allow a custom setState handler on the using component
  • Loading branch information
RubaXa committed Oct 14, 2015
2 parents d0c1226 + d779c39 commit 282e459
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion react-sortable-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@
}

newState[_getModelName(this)] = items;
this.setState(newState);
if (copyOptions["stateHandler"]) {
this[copyOptions["stateHandler"]](newState);
} else {
this.setState(newState);
}
(this !== _activeComponent) && _activeComponent.setState(remoteState);
}

Expand Down

0 comments on commit 282e459

Please sign in to comment.