Skip to content

Conversation

@ion-andrusciac-lgp
Copy link
Contributor

@ion-andrusciac-lgp ion-andrusciac-lgp commented Sep 17, 2025

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • At least one test case is included for this feature or bug fix
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

Changed scroll animation method

Resolution

A new scrolling animation logic was developed to address a limitation in Google Chrome, which struggles to handle repeated calls to the native 'animated' scroll function. To overcome this, the solution implements the requestAnimationFrame API to programmatically control the scroll animation while maintaining the use of native scrolling.
It computes the scroll direction on each axis, then repeatedly calls scrollBy in small 18px steps (instant behavior) until the target is reached or a scroll bound is hit.

By leveraging requestAnimationFrame, the animation frames are synchronized with the browser’s refresh rate, resulting in smoother performance and improved visual consistency. This approach optimizes rendering efficiency and ensures a seamless scrolling experience.

Additional Considerations

Compared to previous solution, here I used scrollBy instead of scrollTo. Also, reduced position calculations.

Links

WRR-29169

Comments

Enact-DCO-1.0-Signed-off-by: Ion Andrusciac [email protected]

@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.61%. Comparing base (faf42b2) to head (538f7f6).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
packages/ui/useScroll/useScroll.js 0.00% 2 Missing and 1 partial ⚠️
packages/ui/Scroller/ScrollerBasic.js 96.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3353      +/-   ##
===========================================
+ Coverage    82.54%   82.61%   +0.07%     
===========================================
  Files          153      153              
  Lines         7154     7179      +25     
  Branches      1892     1903      +11     
===========================================
+ Hits          5905     5931      +26     
+ Misses         980      979       -1     
  Partials       269      269              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@daniel-stoian-lgp
Copy link
Contributor

daniel-stoian-lgp commented Oct 20, 2025

can you put in the PR description what were the issues that led to developing the new scrolling logic? And a short description of the adopted solution

Copy link
Contributor

@daniel-stoian-lgp daniel-stoian-lgp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@alexandrumorariu alexandrumorariu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants