You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using the Ticker library (specifically the react-fast-marquee component), I observed that the speed of the Ticker component changes unexpectedly when other components are created in the project. The animation speed, controlled by the duration value, appears inconsistent even under identical conditions (e.g., same screen resolution).
Using the browser’s developer tools (Elements tab), I confirmed that the animation speed varies depending on the duration value. However, the issue is that this duration value changes unpredictably every time the page is reloaded, even when the resolution and other conditions remain constant. This suggests that the calculation might be unstable or influenced by external factors.
Steps to Reproduce
Install the react-fast-marquee library at version 1.6.5 (e.g., npm install react-fast-marquee@1.6.5).
Set up a project using the react-fast-marquee library (Ticker component).
Pass the speed prop to the component.
Open the browser and inspect the rendered Ticker component using developer tools.
Note the calculated --duration value in the applied styles.
Reload the page multiple times at the same resolution.
Observe that the --duration value changes with each reload, resulting in inconsistent animation speeds.
Add or remove other components in the project and check if the duration calculation is further affected.
Additional Notes
I reviewed the project’s history and found that PR Recalculate Speed when children change #61 addressed a related issue, but it does not seem to have resolved the instability in the duration calculation.
I’m unsure if I’ve misunderstood the intended behavior or missed other project-specific conditions (e.g., dynamic resizing, untracked dependencies) that might influence this.
If this is confirmed as a valid issue in the library, I’d like to know if it’s appropriate for me to attempt a fix and submit a pull request.
Version
Problem Description
While using the Ticker library (specifically the react-fast-marquee component), I observed that the speed of the Ticker component changes unexpectedly when other components are created in the project. The animation speed, controlled by the duration value, appears inconsistent even under identical conditions (e.g., same screen resolution).
Cause Analysis
I investigated the relevant code in the library:
This calculated duration is then applied to the CSS styles via the marqueeStyle object:
Using the browser’s developer tools (Elements tab), I confirmed that the animation speed varies depending on the duration value. However, the issue is that this duration value changes unpredictably every time the page is reloaded, even when the resolution and other conditions remain constant. This suggests that the calculation might be unstable or influenced by external factors.
Steps to Reproduce
Additional Notes