fix spin timer, close #6383

This commit is contained in:
afc163 2017-06-06 20:38:23 +08:00
parent 41f157e596
commit b991137628

View File

@ -78,6 +78,9 @@ export default class Spin extends React.Component<SpinProps, any> {
}
} else {
if (spinning && delay && !isNaN(Number(delay))) {
if (this.delayTimeout) {
clearTimeout(this.delayTimeout);
}
this.delayTimeout = setTimeout(() => this.setState({ spinning }), delay);
} else {
this.setState({ spinning });