bug: jQuery kills scroll momentum in collection-repeat
Type: bug
Platform: all
Adding jQuery kills the scroll momentum in collection-repeat. Can be observed on desktop, too:
http://codepen.io/zapatek/pen/hnatq
Here is the working version with only jQuery link removed: http://codepen.io/zapatek/pen/dxyLe
+1. Same problem here. Removing the jQuery dependency makes the scroll work smoothly.
I'm having this problem as well. I wonder if the people in issue #2265 are also including jQuery?
I'm hitting this issue, and can confirm that I am including jQuery.
Had the same exact issue. Was tearing my hair out.. I can get rid of jQuery, but would be nice to get this fixed.
+1. When using jQuery this line in collectionRepeatdirective makes the issue appears.
scrollCtrl.$element.on('scroll.resize', rerenderOnResize);
Well, it set our planning back for a good part of a week, but we removed all jQuery, upgraded to beta 13 and now everything (and I mean everything) is a whole lot faster.
We're in the process of doing the same thing @crooy We were just using jQuery for animations mostly so we switched to using CSS transitions and everything seems an order of magnitude faster. I wonder, is jQuery overloading some common method in jqLite that is slowing it down universally?
Me too. Using ng-repeat is ok. Lost inertia when using collection-repeat
Note, this is only with jQuery 2.x, 1.x works fine. Looking in to it...
A note regarding performance and jQuery: It's not. It leaks memory quite a bit, and animations aren't performant. Still, it's a pretty universal library and we should fix this.
@perrygovier Actually the problem is there from jQuery version 1.7.0 onwards. Please see the updated codepen:
http://codepen.io/zapatek/pen/hnatq
Unfortunately, as of beta-14 this is still not fixed. I guess it would be safe to caution other users that ionic framework still does not play well with jQuery.
+1 on beta-14 with jQuery 1.11
@rdelafuente is right about it being that line:
scrollCtrl.$element.on('scroll.resize', rerenderOnResize);
jQuery sees that as "on every scroll event" but jqLite does not since its on() method does not support namespacing https://docs.angularjs.org/api/ng/function/angular.element
A fix is to change "scroll.resize" to "scroll-resize" on that line, and also add that event to the resize function in the $ionicScroll controller:
self.resize = function() {
return $timeout(resize).then(function() {
$element && $element.triggerHandler('scroll.resize scroll-resize');
});
};
The best solution going forward would most likely be removing all namespaced events in the Ionic Framework.
I'll be digging in to this one. Note that #2265 may be related to this issue.
Working in nightly builds with the collection-repeat refactor: http://codepen.io/ionic/pen/YPvWBr