NXT-9810: Added support for scrollend event#3389
Merged
alexandrumorariu merged 37 commits intodevelopfrom Feb 25, 2026
Merged
Conversation
…nto feature/NXT-9808
# Conflicts: # packages/ui/resolution/index.js
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3389 +/- ##
===========================================
+ Coverage 83.18% 83.85% +0.66%
===========================================
Files 154 154
Lines 7332 7388 +56
Branches 1927 1942 +15
===========================================
+ Hits 6099 6195 +96
+ Misses 969 941 -28
+ Partials 264 252 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ion-andrusciac-lgp
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Issue Resolved / Feature Added
scrollend event was launched https://developer.mozilla.org/en-US/docs/Web/API/Document/scrollend_event
Resolution
Added scrollend event support, with fallback for older browsers
Scenario: User scrolls with mouse wheel
Before
User scrolls
onScroll fires (many times per second)
scrollStopJob.start() - Restarts 200ms timer on EVERY scroll event
onScroll fires again... timer resets
onScroll fires again... timer resets
User stops scrolling
No more onScroll events...
Wait 200ms...
Timer expires → scrollStopOnScroll() is called
Result - 200ms delay
After
User scrolls
The implementation now uses hybrid logic - different behavior for different scroll types:
For Mouse/Touch Scrolling
User scrolls with mouse wheel
onScroll fires (many times)
scrollStopJob.start() - Starts 200ms fallback timer
onScroll fires again... fallback timer resets
User stops scrolling
Browser fires 'scrollend' event
onScrollEnd() called
→ isScrollAnimationTargetAccumulated? NO (mouse/touch)
→ scrollStopOnScroll() called immediately
→ scrollStopJob.stop() - Cancel fallback timer
Result: Instant scroll end detection (~0ms delay)
For Keyboard Scrolling (Accumulating)
User holds arrow key down
onScroll fires (many times)
scrollStopJob.start() - Starts 200ms fallback timer
onScroll fires again... fallback timer resets
scrollEndGraceTimer cleared (allows accumulation to continue)
User releases arrow key
Browser's smooth scroll continues briefly...
Browser fires 'scrollend' event
onScrollEnd() called
→ isScrollAnimationTargetAccumulated? YES (keyboard)
→ Start 100ms grace timer
→ scrollStopJob.stop() - Cancel fallback timer
More 'scrollend' events might fire (smooth scroll continuing)...
→ Each one restarts the 100ms grace timer
100ms passes with no new scrollend events
Grace timer expires → scrollStopOnScroll() called
Result: 100ms debounced scroll end (prevents callback spam)
Additional Considerations
No changelog because the component is private
JSDOM does not support scrollend event , so the unit tests cannot cover scrollend
Another issue that was solved: Vertical wheel scrolling triggered onScrollStop twice - once from the 200ms fallback timer, and again from the scrollend event arriving late.
Solution:
Links
NXT-9810
Comments
Enact-DCO-1.0-Signed-off-by: Daniel Stoian (daniel.stoian@lgepartner.com)