Skip to content

fix(gestures): remove drag event from config #1744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/lib/core/gestures/MdGestureConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export class MdGestureConfig extends HammerGestureConfig {

/* List of new event names to add to the gesture support list */
events: string[] = [
'drag',
'dragright',
'dragleft',
'longpress',
'slide',
'slidestart',
Expand Down Expand Up @@ -41,14 +38,13 @@ export class MdGestureConfig extends HammerGestureConfig {
// Notice that a HammerJS recognizer can only depend on one other recognizer once.
// Otherwise the previous `recognizeWith` will be dropped.
let slide = this._createRecognizer(pan, {event: 'slide', threshold: 0}, swipe);
let drag = this._createRecognizer(slide, {event: 'drag', threshold: 6}, swipe);
let longpress = this._createRecognizer(press, {event: 'longpress', time: 500});

// Overwrite the default `pan` event to use the swipe event.
pan.recognizeWith(swipe);

// Add customized gestures to Hammer manager
mc.add([swipe, press, pan, drag, slide, longpress]);
mc.add([swipe, press, pan, slide, longpress]);

return mc;
}
Expand All @@ -58,7 +54,7 @@ export class MdGestureConfig extends HammerGestureConfig {
let recognizer = new (<RecognizerStatic> base.constructor)(options);

inheritances.push(base);
inheritances.forEach((item) => recognizer.recognizeWith(item));
inheritances.forEach(item => recognizer.recognizeWith(item));

return recognizer;
}
Expand Down