Skip to content

Commit

Permalink
perf(menu): avoid change detection when it isn't needed (#8986)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat authored and brandyscarney committed Nov 4, 2016
1 parent cf1196a commit d531ec2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/menu/menu-gestures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class MenuContentGesture extends SlideEdgeGesture {
threshold: 0,
maxEdgeStart: menu.maxEdgeStart || 50,
maxAngle: 40,
zone: false,
debouncer: new NativeRafDebouncer(),
gesture: gestureCtrl.create('menu-swipe', {
priority: GesturePriority.MenuSwipe,
Expand Down Expand Up @@ -58,7 +59,6 @@ export class MenuContentGesture extends SlideEdgeGesture {
'z', z,
'stepValue', stepValue);

ev.preventDefault();
this.menu.swipeProgress(stepValue);
}

Expand Down
6 changes: 5 additions & 1 deletion src/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,11 @@ export class Menu {
return;
}
this._getType().setProgessStep(stepValue);
this.ionDrag.emit(stepValue);

let ionDrag = this.ionDrag;
if (ionDrag.observers.length > 0) {
this._zone.run(ionDrag.emit.bind(ionDrag, stepValue));
}
}

/**
Expand Down

0 comments on commit d531ec2

Please sign in to comment.