mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
perf(menu): avoid change detection when it isn't needed (#8986)
This commit is contained in:
committed by
Brandy Carney
parent
cf1196a209
commit
d531ec2316
@@ -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,
|
||||
@@ -58,7 +59,6 @@ export class MenuContentGesture extends SlideEdgeGesture {
|
||||
'z', z,
|
||||
'stepValue', stepValue);
|
||||
|
||||
ev.preventDefault();
|
||||
this.menu.swipeProgress(stepValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user