When I remove this function: attachToDocument everything works extremely faster. In addition, when you take a snapshot of memory with having that function we'd see lots of detached DOM nodes held by gestureStart function which is never release them. Saying that please anybody assist me how to avoid gestures in my SPA and make its life easier. (the app wont be used on mobile devices)
@AndrewEastwood - you should be able to configure the $mdGesture to skip click hijacks (which also disables the attachToDocument() code.
// In the angular `config` phase...
app.config(function($mdGestureProvider) {
// To skip attachToDocument() and addEventListener(s)
$mdGestureProvider.skipClickHijack();
});
That's right. But still this part will is not under conditions and will add extra listeners to document:
// Listen to all events to cover all platforms.
var START_EVENTS = 'mousedown touchstart pointerdown';
var MOVE_EVENTS = 'mousemove touchmove pointermove';
var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';
angular.element(document)
.on(START_EVENTS, gestureStart)
.on(MOVE_EVENTS, gestureMove)
.on(END_EVENTS, gestureEnd)
// For testing
.on('$$mdGestureReset', function gestureClearCache () {
lastPointer = pointer = null;
});
@AndrewEastwood - Check out PR #10885.
The memory leak issue still needs to be investigate.
@ThomasBurleson, that would be awesome update! thanks!
Note that v1.1.6 is scheduled for 2 months from now!
To get this^ change sooner - After the v1.1.5 release - you can easily fork this repository, locally merge the PR, and build your own version of ngM1.
gotcha
New PR https://github.com/angular/material/pull/11246 posted to allow disabling all gestures for perf. Hopefully we can get it into 1.1.9 next week.
Most helpful comment
Note that v1.1.6 is scheduled for 2 months from now!