0

I'm trying to track down an issue with mousewheel scrolling in chrome on Windows 10. On one page, if smooth scrolling is enabled, each tick of the mouse wheel results in only about 1.25px change in scroll, and doesn't go very fast even if you move the wheel considerably in a small amount of time.

If you disable smooth scrolling (via chrome://flags), each tick is about 125 pixels.

I haven't been able to find the location in the chrome source where the delta is determined based on the smooth-scrolling setting, and was wondering if someone else knows where it is and might have some insight into exactly what chrome is doing based on the smooth-scrolling setting.

Really weird.

thx!

user655489
  • 1,316
  • 3
  • 14
  • 21

1 Answers1

0

The answer posted at How to disable smooth scrolling in Chrome by Ben Mosher. The snippet from his answer that addresses it is this:

function wheeled(event) {
  event.preventDefault()

  container.scrollTop += event.deltaY
  container.scrollLeft += event.deltaX
}

container.addEventListener('wheel', wheeled, { passive: false, capture: true })
// actual render code is in the `scrolled` handler because
// there are other wheel events in the code that adjust the scroll position
container.addEventListener('scroll', scrolled, { passive: true })
user655489
  • 1,316
  • 3
  • 14
  • 21