Skip to content

Commit

Permalink
fix list-sort insanity
Browse files Browse the repository at this point in the history
  • Loading branch information
jljsj33 committed Oct 25, 2016
1 parent 0a630cd commit 5a4ab21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/theme/template/Splicing/ListSort.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default class ListSort extends React.Component {
this.mouseXY = null;
this.childStyle = [];
this.children = [];
this.isAnimation = false;
}

componentDidMount() {
Expand Down Expand Up @@ -123,6 +124,9 @@ export default class ListSort extends React.Component {
}

onMouseDown = (i, e) => {
if (this.isAnimation) {
return;
}
const rect = this.dom.getBoundingClientRect();
const style = {
height: `${rect.height}px`,
Expand Down Expand Up @@ -179,6 +183,7 @@ export default class ListSort extends React.Component {
this.listDom.className = `${this.listDom.className
.replace(this.props.dragClassName, '').trim()} ${this.props.dragClassName}`;
}
this.isAnimation = true;
this.setState({
style,
childStyle,
Expand Down Expand Up @@ -227,6 +232,7 @@ export default class ListSort extends React.Component {
children,
animation: [],
}, () => {
this.isAnimation = false;
if (callbackBool) {
this.props.onChange(children);
}
Expand Down

0 comments on commit 5a4ab21

Please sign in to comment.