Skip to content

refactor: simplify logic that prevents instant scroll chaining - #10128

Merged
vursen merged 2 commits into
mainfrom
simplify-overscroll-prevention-logic
Sep 5, 2025
Merged

vursen merged 2 commits into
mainfrom
simplify-overscroll-prevention-logic

Conversation

@vursen

@vursen vursen commented Sep 5, 2025 •

Copy link
Copy Markdown
Contributor

Description

This PR replaces the custom mouse wheel logic that prevented instant scroll chaining at the end of the virtualized list with an overscroll-behavior: none applied while scrolling and cleared after a short timeout once scrolling finishes. This simplifies the logic while ensuring that multiple touchpad swipes required to get to the end of a large grid still don't accidentally cause the whole page to scroll. Bonus: it now works on touch devices too.

Type of change

  • Refactor

@vursen
vursen force-pushed the simplify-overscroll-prevention-logic branch from 1d229ba to 83b4b70 Compare September 5, 2025 11:30
@vursen
vursen requested a review from tomivirkki September 5, 2025 12:03
@vursen
vursen force-pushed the simplify-overscroll-prevention-logic branch from 4a9f204 to 438d143 Compare September 5, 2025 12:10
expect(wrapper.scrollTop).to.equal(0);
it('should prevent outer scrolling right after reaching the end', () => {
scrollTarget.scrollTop = scrollTarget.scrollHeight;
expect(scrollTarget.style.overscrollBehavior).to.equal('none');

@vursen vursen Sep 5, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried implementing a mouseWheel WTR command but I couldn't get it to work in Playwright – the tests just got stuck, so I fell back to this basic test.

@vursen
vursen force-pushed the simplify-overscroll-prevention-logic branch from 438d143 to 7d2b483 Compare September 5, 2025 12:24
@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2025

Copy link
Copy Markdown

@web-padawan web-padawan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if we could also replace __patchWheelOverScrolling in combo-box scroller with overscroll-behavior?

@vursen

vursen commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

I wonder if we could also replace __patchWheelOverScrolling in combo-box scroller with overscroll-behavior?

Hmm, good idea!

@vursen
vursen requested a review from web-padawan September 5, 2025 12:36
@vursen
vursen merged commit 708cad2 into main Sep 5, 2025
@vursen
vursen deleted the simplify-overscroll-prevention-logic branch September 5, 2025 13:10
@vursen vursen changed the title refactor: simplify logic that prevents immediate overscroll refactor: simplify logic that prevents instant scroll chaining Sep 7, 2025
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.

3 participants