-
Notifications
You must be signed in to change notification settings - Fork 146
Dynamically added cards don't "restack" #53
Comments
Same here, been looking around but so far I really don't now what to call or to refresh |
+1 |
The same here. I've tried several ways of adding the cards but they always end up with bad stacking position (exactly as in the codepen). Any news on this? |
Same here, this is really frustrating. No feature is better then a broken one (or one missing basic functionality). |
I assume the "unshift" isn't giving you expected results? I tried using unshift and it seems to work for me.
|
I found the currently visible card was typically the last in the array, so adding freshly loaded cards to the front (aka. array.unshift) fixed it for me. |
The issue is that the card zorder is set via sortCards which runs once after the ng-repeat first renders. One way to get around it is to just set the zorder yourself for each card via an inline style. You can see an example here: http://codepen.io/beoutside/pen/yNoWrR |
Here's a fork of the original pen with the z-order styling applied. It also changes addCard to add cards to the end of the array instead of the beginning since the first card is shown at the top of the stack. Now you can see a new card come into view at the bottom of the stack. |
have you tried this: |
On load (and using ng-if) the cards I load in appear as a neat stack, however when I swipe a card out and a replacement is added from my API, the card doesn't appear in the correct place. Is there something I need to call?
I've created a codepen to illustrate the issue - http://codepen.io/anon/pen/ByYJmz
The text was updated successfully, but these errors were encountered: