diff --git a/bower.json b/bower.json index 380977ec..3b170120 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "react-reorderable", - "version": "1.0.3", + "version": "1.1.0", "description": "Drag & drop, touch enabled, reorderable / sortable list, React component", "homepage": "https://github.com/JakeSidSmith/react-reorderable", "license": "MIT", diff --git a/package.json b/package.json index eeb4e19b..de4c7011 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-reorderable", - "version": "1.0.3", + "version": "1.1.0", "description": "Drag & drop, touch enabled, reorderable / sortable list, React component", "author": "Jake 'Sid' Smith", "license": "MIT", diff --git a/reorderable.js b/reorderable.js index 4cca8590..cb23a5e0 100644 --- a/reorderable.js +++ b/reorderable.js @@ -21,13 +21,15 @@ } }, startDrag: function (dragOffset, draggedStyle) { - this.setState({ - dragOffset: dragOffset, - draggedStyle: draggedStyle, - originalPosition: draggedStyle, - held: true, - moved: false - }); + if (!this.props.disableReorder) { + this.setState({ + dragOffset: dragOffset, + draggedStyle: draggedStyle, + originalPosition: draggedStyle, + held: true, + moved: false + }); + } }, itemDown: function (item, index, event) { event.preventDefault(); @@ -434,10 +436,14 @@ }, componentWillReceiveProps: function (props) { // Updates list when props changed - this.setState({list: props.list}); + this.setState({ + list: props.list + }); }, getInitialState: function () { - return {list: this.props.list || []}; + return { + list: this.props.list || [] + }; }, render: function () { var self = this;