Skip to content

Commit

Permalink
Added flag to programatic scrolling to avoid infinite scroll during r…
Browse files Browse the repository at this point in the history
…edraw. (visjs#238)
  • Loading branch information
Arthur Cheung committed Jan 3, 2020
1 parent 29f5f3b commit d004d49
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/timeline/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ class Core {
*/
function onMouseScrollSide(event) {
if (!me.options.verticalScroll) return;
if(me._isProgramaticallyScrolled){
me._isProgramaticallyScrolled = false;
return;
}
event.preventDefault();
if (me.isActive()) {
const adjusted = -event.target.scrollTop;
Expand Down Expand Up @@ -1355,7 +1359,7 @@ class Core {
this.dom.left.parentNode.scrollTop = -this.props.scrollTop;
this.dom.right.parentNode.scrollTop = -this.props.scrollTop;
}

this._isProgramaticallyScrolled = true;
return this.props.scrollTop;
}

Expand Down

0 comments on commit d004d49

Please sign in to comment.