diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 9737be233..ff2c77ecc 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -183,12 +183,12 @@ const Timeline = { // if the status is too far from viewport, check the next/previous ones if // they happen to be better while (err < -100 && approxIndex < statuses.length - 1) { - approxIndex++ err += statuses[approxIndex].offsetHeight + approxIndex++ } while (err > window.innerHeight + 100 && approxIndex > 0) { - err -= statuses[approxIndex].offsetHeight approxIndex-- + err -= statuses[approxIndex].offsetHeight } // this status is now the center point for virtual scrolling and visible