Skip to content

Set event listener passive option to false #42

@dunstad

Description

@dunstad

In chrome on the dual.html example, I see this error:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

It can be fixed by changing these lines:

this.container.addEventListener( 'touchstart' , this.$onTouchStart , false, );
this.container.addEventListener( 'touchend' , this.$onTouchEnd , false );
this.container.addEventListener( 'touchmove' , this.$onTouchMove , false );

as follows:

this.container.addEventListener( 'touchstart' , this.$onTouchStart , {capture: false, passive: false} );
this.container.addEventListener( 'touchend' , this.$onTouchEnd , {capture: false, passive: false} );
this.container.addEventListener( 'touchmove' , this.$onTouchMove , {capture: false, passive: false} );

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