Skip to content

Touch move not triggering filter #124

@ChrisGatzo

Description

@ChrisGatzo

Hello,

I'm trying to implement a filter that would circumvent execution of touchmove.zoom event and I noticed in the source code that the touchmoved method does not do

if (!filter.apply(this, arguments)) return;

The obvious question is why? Will something break if make this change? So far it works fine.

The reason I want to do this is because I want zoom to only handle multi touch events and let the single touch bubble up to the browser, so that the user can still scroll the page with one finger and zoom/pan with two fingers. So then the filter can be something like

      d3
      .zoom()
      .filter(() => {
        return !(d3.event.type === 'touchmove' && d3.event.touches.length <= 1);
      })

Thanks

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