Skip to content

smoothScrollTo fights user scrolling for 800ms with no input cancellation #266

Description

@maboa

Summary

(As of v2.6.2.) The manual rAF scroll animation (hyperaudio-lite.js:846-875) assigns container.scrollTop unconditionally every frame for 800 ms. Unlike native scrollIntoView({behavior:'smooth'}) — which browsers cancel on user input — this overrides wheel/trackpad gestures: during playback, every paragraph change starts an 800 ms animation, and a user trying to scroll up to re-read is yanked back frame by frame. (In hyperaudio-lite-editor, pauseAutoscroll only engages on typing, not on scroll gestures, so reading-while-listening hits this directly.)

Fix

Cancel scrollAnimationId on wheel/touchstart/keydown on the container (listeners registered on the instance's existing abort signal), or abort the animation when the observed scrollTop diverges from the last value the animation wrote.

Found reviewing the copy vendored in hyperaudio-lite-editor / GliderMac (2026-07-11).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions