Skip to content

Commit

Permalink
fix: cease autoplay when maidr is deactivated by clicking outside the…
Browse files Browse the repository at this point in the history
… interactive plot
  • Loading branch information
krishnanand5 committed Aug 26, 2024
1 parent 2764cd0 commit 3942a4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,10 @@ class Control {

constants.autoplayId = setInterval(function () {
position.x += step;
if (!plot || !plot.plotData) {
constants.KillAutoplay();
return;
}
if (position.x < 0 || plot.plotData.length - 1 < position.x) {
constants.KillAutoplay();
lockPosition();
Expand Down

0 comments on commit 3942a4f

Please sign in to comment.