bug: Ionic Slide Box Breaks on splice an item. Goes to last index and overlaps.
Type: bug
Platform: ios 8 webview
Here is the code pen that shows the error. Try removing the item , example product 3, the slide box slides to last product and overlaps the other items. ( see the pager, it moves )
http://codepen.io/anon/pen/qEvyLV?editors=101
any help would be big help.
EDIT: I included a $ionicSlideBoxDelegate.update(); on slide change function, it seems to slightly fix the issue but only on slide change. Its not a 100% solution. Check Code pen.
The slidebox implementation is broken when you try to update the underlying collection.
Just another demonstration of it. Also, my last comment links to a branch that has not been included in the RC's yet that contains an overhaul of the slidebox implementation. https://github.com/driftyco/ionic/issues/3076
If you give the slidebox a millisecond or two for some asynchronous actions, it looks to work properly: http://codepen.io/perrygovier/pen/QwoPbb?editors=101
Let me know if that doesn't resolve the issue
This is a good try, but unfortunately, its all messy now also, if I splice 1st product it goes to product3, and one major problem , if I splice last object (product 11) it splices behind leaving the screen blank.. @perrygovier
Possible work around I found to this problem: setting a SetInterval javascript function. though its not 100% correct , it is one of the workaround when you want to splice slidebox slides.
here is a code pen for the same: http://codepen.io/anon/pen/qEvyLV?editors=101
I'm having a very similar issue on Android as well, Looks like some users (including me) found this closed issue and are posting there:
https://github.com/driftyco/ionic/issues/1578#issuecomment-74268456
@CodyMorris have you tried the suggestion of calling update multiple times in a $timeout? It is the only known workaround right now with what is released. I use a loop that runs every 250ms for 4 times just to be sure.
@agnellvj Yes thats exactly what I do right now. I have set out a Interval function of javascript to call update every 200ms for 2 seconds.
Is there any fix of this issue? Please update.
@agnellvj yeah, that works but its definitely not ideal - thanks for the reminder though
Well...This worked for me though this is not a solution of the bug. $scope.trashMe = function(index) { var indexToremove = $ionicSlideBoxDelegate.currentIndex(); $scope.next(); $timeout(function() { var data = $scope.slideData; data.splice(indexToremove, 1); $scope.slideData = data; $ionicSlideBoxDelegate.update(); }); $scope.previous(); };
Hey guys, look at PR: https://github.com/driftyco/ionic/pull/3842
It's all broken because of angular ngAnimate, disabling it on the ionSlideBox directive works.
A timeout would just be a workaround. Let me know if that suits!
Having same issue.
Any progress in this issue, still facing the problem.
having same problem, do you solved the problem?
Hey everyone, can you try the new slidebox just pushed to master (available in upcoming 1.2):
<ion-slides options="options">
<ion-slide-page>
</ion-slide-page>
</ion-slides>
New slidebox should fix this ,closing until I get confirmation