Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Events: Implement proper source event binding/unbinding #7881

Open
@gabrielschulhof

Description

@gabrielschulhof

Currently, we attach event handlers for the purposes of computing our touch events using something as simple as .bind( "touchmove", function() { /* .... */ }); during setup() which we then remove with .unbind( "touchmove" ); during teardown(). This is really bad! What if the developer has separately hooked up their own touchmove event handler? When she removes the custom event handler, our teardown() will also remove their event handler!

So, in an event's setup() we basically need to store the functions which we pass to .bind() so we can later pass them to .unbind() inside teardown(), removing exactly those event handlers we have attached.

This is already implemented for swipe, but we should make sure to implement it for all our events when we review the events (perhaps as part of pointer event adoption).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions