Skip to content

Commit

Permalink
Revert "Fixing column drag scroll with cell recycling"
Browse files Browse the repository at this point in the history
This reverts commit 158a58b.
  • Loading branch information
Kamran Asif committed Aug 3, 2016
1 parent 158a58b commit 02dbb62
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion examples/ReorderExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class ReorderExample extends React.Component {
{...this.props}>
{this.state.columnOrder.map(function (columnKey, i) {
return <Column
allowCellsRecycling={true}
columnKey={columnKey}
key={i}
isReorderable={true}
Expand Down
2 changes: 1 addition & 1 deletion src/FixedDataTableCellDefault.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var FixedDataTableCellDefault = React.createClass({
},

render() {
var {height, width, style, className, children, columnKey, rowIndex, ...props} = this.props;
var {height, width, style, className, children, columnKey, ...props} = this.props;

var innerStyle = {
height,
Expand Down
3 changes: 1 addition & 2 deletions src/FixedDataTableCellGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ var FixedDataTableCellGroupImpl = React.createClass({
var currentPosition = 0;
for (var i = 0, j = columns.length; i < j; i++) {
var columnProps = columns[i].props;
var recycable = columnProps.allowCellsRecycling && !isColumnReordering;
if (!recycable || (
if (!columnProps.allowCellsRecycling || (
currentPosition - props.left <= props.width &&
currentPosition - props.left + columnProps.width >= 0)) {
var key = 'cell_' + i;
Expand Down
8 changes: 2 additions & 6 deletions src/FixedDataTableColumnReorderHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ var FixedDataTableColumnReorderHandle = React.createClass({

componentWillUnmount() {
if (this._mouseMoveTracker) {
cancelAnimationFrame(this.frameId);
this.frameId = null;
this._mouseMoveTracker.releaseMouseMoves();
this._mouseMoveTracker = null;
}
Expand Down Expand Up @@ -103,7 +101,7 @@ var FixedDataTableColumnReorderHandle = React.createClass({

this._distance = 0;
this._animating = true;
this.frameId = requestAnimationFrame(this._updateState);
requestAnimationFrame(this._updateState);
},

_onMove(/*number*/ deltaX) {
Expand All @@ -112,15 +110,13 @@ var FixedDataTableColumnReorderHandle = React.createClass({

_onColumnReorderEnd() {
this._animating = false;
cancelAnimationFrame(this.frameId);
this.frameId = null;
this._mouseMoveTracker.releaseMouseMoves();
this.props.onColumnReorderEnd();
},

_updateState() {
if (this._animating) {
this.frameId = requestAnimationFrame(this._updateState)
requestAnimationFrame(this._updateState)
}
this.setState({
dragDistance: this._distance
Expand Down

0 comments on commit 02dbb62

Please sign in to comment.