v149 · JavaScript · demo

Scroll Monitor

Watch scrollTo() promises resolve or report interruption in real time. Interrupt a smooth scroll mid-flight to see the interrupted: true result.

Promise log (newest at top)

// Chrome 149+: scrollTo returns a Promise
const result = await container.scrollTo({
  top: container.scrollHeight,
  behavior: 'smooth',
});

// result.interrupted === false → completed normally
// result.interrupted === true  → was cut short
if (result.interrupted) {
  console.log('Scroll was interrupted');
} else {
  console.log('Scroll completed');
}

see also