Skip to content

Touch scrolling a virtual list logs "Ignored attempt to cancel a touchmove event" and scrolls the page #393

Closed

Description

@Pareder

Environment

  • Version: @rc-component/virtual-list 1.6.0
  • Device / OS: Chrome DevTools device emulation
  • Browser: Chrome latest

Steps to reproduce

  1. Render a List with enough data to virtualize (e.g. height={200}, itemHeight={20}, 1000 items) on a page that is taller than the viewport, so the page can scroll too.
  2. On a touch device (or Chrome DevTools with device emulation), start a swipe inside the list and scroll it.

Expected

  • The list scrolls and the page stays put.
  • No console warnings.

Actual

  • The page scrolls together with the list.
  • The console fills with warnings, one per touchmove:
[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

Cause

In useMobileTouchMove, the only listener on the list when a touch begins is a passive touchstart. The non-passive touchmove listener is added to e.target inside that touchstart handler.

Browsers decide whether a touch sequence can be cancelled by checking for non-passive touch listeners when the touch begins. That check runs before the touchstart handler adds its listener, so the browser treats the whole touch as non-blocking. Every touchmove then arrives with cancelable: false, and the preventDefault() call in onTouchMove is ignored, which is what logs the warning. The browser's native scroll is never stopped, so the page scrolls along with the list.

A second, smaller source of the same warning: after a swipe passes the list's top or bottom edge, the browser hands the scroll to the page (originScroll). From then on the moves can't be cancelled, but preventDefault() is still called on them if the swipe reverses.

Proposed fix

  1. Register a touchmove listener with { passive: false } on the list element itself when the hook mounts, so the list area already counts as blocking when a touch begins. The real handler stays on e.target, because virtualized items can be removed mid-swipe and events from a removed target never bubble up to the list.
  2. Only call e.preventDefault() when e.cancelable is true.

Similar issue

Activity

  1. Mittalnew commented on Nov 16, 2026

    @Mittalnew

    Hi! Thanks for the detailed root-cause analysis. I'd like to work on this. My plan is to register a non-passive touchmove listener ({ passive: false }) on the list container when the hook mounts, instead of adding it to e.target inside the passive touchstart handler. The browser would then see a cancelable listener when the touch begins, so preventDefault() works, the page stays put, and the intervention warnings go away. I'd keep the existing offset/inertia logic and add a test that simulates a touch scroll. Could you assign it to me?

  2. Pareder commented on Nov 16, 2026

    @Pareder
    ContributorAuthor

    @Mittalnew I've already created a PR #394.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions