Here are a few more issues I’m seeing around animating the slidebox slides after testing out the latest nightly (565). Note that my app is based off the slide menu starter template so its using a ion-nav-viewelement and that same overall template structure.
I have to set visibility:visible for .slider in css or else the slidebox is hidden initially.
I don’t see the widths being set for the slides and their parent container which I believe is the overall problem for my sliding animation:
.slider-slides width is no longer set to total width of all slides.
each slide itself no longer has its set width to match screen width
while sliding current slide, its translate3d immediately jumps to -100% so slide just disappears rather than giving smooth slide
The slide states seem to be off, what is my actual visible slide says slide-state=previous, inspecting the code the slide-state=selected is the next slide in the DOM and slide-state=next is after that.
I’ve started some testing. The first thing I have noticed is that performing a pop() to the slidebox data structure (removing items from the end of the slidebox) DOESNT change the slide count. In the previous code, it did.
My application is attempting to implement an infinite slidebox where I can manage the addition and deletion of slides from the beginning and ending of the slidebox.
@jajohga This is definitely a bug … we only ever keep the current, previous, and next slides in the DOM, and have to do some hacky things to make ngRepeat work. I’ll look into it.
I was using SASS files from the stable build so it was rendering incompatible styles for the nightly. I’m guessing the project’s SASS files will be updated when the next stable build is released?
@andy I’m seeing big improvements after you pulled out the feature that only keeps 3 slides in the DOM.
One bug I see now is it seems like the on-slide-changed isn’t firing for each slide change now? Still determining if thats a bug in my code.
Also, (not a huge deal but fyi) I noticed while switching between landscape and portrait, the heights for some elements aren’t updating. I have a parent ion-view and ion-side-menu-content that I have to set height:100% !important in my css which fixes it. The slides themselves do update their heights properly.
@ccantrell just pushed a fix for the onSlideChanged callback - it was only firing if you provided your own selected attr and changed the binding from outside the slidebox. Now it always fires when selection changes.
Could you post a codepen where the size isn’t updating correctly?
Great additions guys! I can remove all of my custom code where i was hiding all but current, previous, and next slides to improve performance! Looks like you are doing it with slide-state="current" now. Awesome!
Only one big issue I am seeing, if I start the slideshow with the last slide being active, it’s state doesnt get set to current instead all slides are detached. If I enter on any other slide it works fine or if I enter at another index and then wipe to the last slide, it works fine.
The easiest case to test is probably just having a slideshow with a single slide AND set selected=0 on ion-slide-box. If you have more than one slide, they will all work, if you only have one, it will not show up.
UPDATE: fixed liked this if anyone is experiencing the same issue
I have a slidebox on an app frontpage which I don’t have any issues with. However I need to show the frontpage and therefore the slidebox in two languages. To achieve this I tried using angular tabs with a separate slidebox in each tab which produced some strange results. The css on one of them would not render correctly and the other would be laggy. Would this update resolve that issue?
Got it all working with the new version, but the sliding is no longer very smooth on ios (or simulator). For instance if you half slide and then release, it doesnt rubber band back into place, it just snaps back with no transition. Not sure if its related to the hiding and showing of the slides or what. I saw that the current, next and previous get a no-animate class while in transition, not sure if thats the problem or not, still looking into it.
Push and pop looks good. Therefore, data manipulation at the end of the slidebox is fine.
Manipulation at the beginning has issues.
Unshift (prepend to beginning) - count update is good, index doesn’t change to compensate for the addition (move over), and the slides are visually showing at the end of the slidebox.
Shift (remove from beginning) - count looks good, index doesn’t compensation. If on the first slide upon shift, works great.
@coen_warmer it’s extremely possible, in fact it’s very easy. Internally, we just have to add a vertical option to the drag listener, and then add a set of vertical CSS rules.
just a question, i am not sure, upgrading the slidebox with collection-repeat in mind? collection repeat will have a way to get index and value? i have to loop trough some objects with index. Also what about pinch to zoom functionality? thanks for the great work!