Skip to content

Commit

Permalink
fix: add programmatic scrolling flag to avoid infinite scroll during …
Browse files Browse the repository at this point in the history
…redraw (#238) (#240)

* Added flag to programatic scrolling to avoid infinite scroll during redraw. (#238)

* Update Core.js

Co-authored-by: Yotam Berkowitz <[email protected]>
  • Loading branch information
arthur-cheung and yotamberk committed Jan 18, 2020
1 parent 6335799 commit 4a79838
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/timeline/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ 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 +1361,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 4a79838

Please sign in to comment.