From 5a4ab21ce061238b9ac7d1d2083c9c9a23568be7 Mon Sep 17 00:00:00 2001 From: jljsj Date: Tue, 25 Oct 2016 16:30:06 +0800 Subject: [PATCH] fix list-sort insanity --- src/theme/template/Splicing/ListSort.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/theme/template/Splicing/ListSort.jsx b/src/theme/template/Splicing/ListSort.jsx index 69308680..6819068c 100644 --- a/src/theme/template/Splicing/ListSort.jsx +++ b/src/theme/template/Splicing/ListSort.jsx @@ -83,6 +83,7 @@ export default class ListSort extends React.Component { this.mouseXY = null; this.childStyle = []; this.children = []; + this.isAnimation = false; } componentDidMount() { @@ -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`, @@ -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, @@ -227,6 +232,7 @@ export default class ListSort extends React.Component { children, animation: [], }, () => { + this.isAnimation = false; if (callbackBool) { this.props.onChange(children); }