angular / material

Material design for AngularJS
https://material.angularjs.org/
MIT License
16.54k stars 3.39k forks source link

$mdGesture: problems with drag events #11204

Open chenlijun99 opened 6 years ago

chenlijun99 commented 6 years ago

Bug

By registering a event listener with this:

$mdGesture.register(element, 'drag', { horizontal: true });

I encountered following problems:

What is the expected behavior?

What is the current behavior?

CodePen and steps to reproduce the issue:

CodePen Demo which shows your issue:
Detailed Reproduction Steps:

Note: the number is the yellow area represents the times "$md.drag" is fired.

What is the use-case or motivation for changing an existing behavior?

Which versions of AngularJS, Material, OS, and browsers are affected?

Angular material 1.1.8 Angularjs 1.6.9 Google Chrome Version 63.0.3239.108 (Official Build) (64-bit)

Is there anything else we should know? Stack Traces, Screenshots, etc.

Splaktar commented 6 years ago

Have you tried the following?

      angular.module('MyApp', ['ngMaterial', 'ngMessages'])
      .config(function($mdGestureProvider) {
        // For mobile devices without jQuery loaded, do not
        // intercept click events during the capture phase.
        $mdGestureProvider.skipClickHijack();
      });
chenlijun99 commented 6 years ago

I've added it to the CodePen. It still doesn't work though.

Splaktar commented 6 years ago

OK, thanks for giving it a shot.