aemsites / infosys

AEM Edge Delivery Services project for Infosys
Apache License 2.0
0 stars 0 forks source link

Hero-Slider Block - Fast sliding issue #54

Closed anuj-adobe closed 3 weeks ago

anuj-adobe commented 4 weeks ago

Sometimes it is observed that hero-slider banner start changing very fastly.

From initial analysis it seems some issue in startProgressBar() method implementation.

I can reproduce this issue by commenting following code in setProgressBarPosition()

progressBars.forEach((progressBar) => {
    progressBar.style.maxWidth = `${cardItemRect.width}px`;
});

Probably due to some race condition, when startProgressBar is getting called progressBar.style.maxWidth is set to 0 and as a result cardItem width in startProgressBar() is also set to 0, which might be causing this issue.