Skip to content

Prevent raising IgnoredEventCancel when scrolling on mobile device #197

@sztobar

Description

@sztobar

Hello, I noticed in the project that I'm working on that there are a pretty high amount of errors raised from markerjs2:

IgnoredEventCancel: intervention: Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

This error is raised when browser is emitting touchmove event on the image, the line that's throwing the error is this:

this.markerImage.addEventListener('touchmove', (ev) => ev.preventDefault());

and the fix is as simple as this:

    this.markerImage.addEventListener('touchmove', (ev) => ev.cancelable && ev.preventDefault());

this isn't anything critical, I can easily filter this error in the monitoring to avoid logging it as something that needs attention, but given that there's a pretty easy fix for it I thought about informing about it. Have a great day.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions