Skip to content

Commit f3a8537

Browse files
committed
fix(slidebox): removing an item breaks slidebox
By default, because Ionic is using ngAnimate, when you use ngRepeat, angular will not destroy the DOM of the element straight away, but it will first add the css class: ng-leave to give the user a chance to set animation when deleting an item from the array. This commit disables $animate for the slideBox element.
1 parent 6c9bc15 commit f3a8537

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: js/angular/directive/slideBox.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
*/
3838
IonicModule
3939
.directive('ionSlideBox', [
40+
'$animate',
4041
'$timeout',
4142
'$compile',
4243
'$ionicSlideBoxDelegate',
4344
'$ionicHistory',
4445
'$ionicScrollDelegate',
45-
function($timeout, $compile, $ionicSlideBoxDelegate, $ionicHistory, $ionicScrollDelegate) {
46+
function($animate, $timeout, $compile, $ionicSlideBoxDelegate, $ionicHistory, $ionicScrollDelegate) {
4647
return {
4748
restrict: 'E',
4849
replace: true,
@@ -153,6 +154,9 @@ function($timeout, $compile, $ionicSlideBoxDelegate, $ionicHistory, $ionicScroll
153154
'</div>',
154155

155156
link: function($scope, $element, $attr) {
157+
// Disable ngAnimate for slidebox and its children
158+
$animate.enabled(false, $element);
159+
156160
// if showPager is undefined, show the pager
157161
if (!isDefined($attr.showPager)) {
158162
$scope.showPager = true;

0 commit comments

Comments
 (0)