Skip to content

Commit

Permalink
fix: clear autoscroller when autoscroll is disabled (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
superandrew213 authored and Claudéric Demers committed Sep 20, 2019
1 parent 162f957 commit 3fd83f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/AutoScroller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ export default class AutoScroller {
}

clear() {
clearInterval(this.interval);
this.interval = null;
if (this.interval != null) {
clearInterval(this.interval);
this.interval = null;
}
}

update({translate, minTranslate, maxTranslate, width, height}) {
Expand Down
1 change: 1 addition & 0 deletions src/SortableContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ export default function sortableContainer(
const {isKeySorting} = this.manager;

if (disableAutoscroll) {
this.autoScroller.clear();
return;
}

Expand Down

0 comments on commit 3fd83f9

Please sign in to comment.