-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Being able to push new cards to the stack under the existing one #18
Comments
Now I really found a workaround for this thanks to JB on disqus. |
Thank you very much for sharing your solution @XPanniX ! It works perfectly. I think this should be part of the README.md! |
You're welcome @tobiasmuecksch In case this kind of "advertisement" isn't wanted here feel free to delete my comment or tell me and I will do it. |
@XPanniX Thank you for your opinion! |
I created a workaround for this after experimenting with it. It is a hack which you may use to achieve this functionality of pushing new card below the stack. After struggling a lot with the behavior of Swing card stack, I noticed that the card pushed at last will always be on the top in the stack causing the issue, no matter if you push it to the beginning or at the end of the stack.
After doing so, you will have card stack with the sequence like - [D, A, B] and since B is pushed at last it will be shown on the top which was supposed to be shown on top after removing card C which is correct. Also after swiping B, you will get A and then D and so on. This is a very beginner level solution but makes you achieve what you want. |
I know it's way too late, but i had the same issue and came across this page. Just add It will basically reverse the use of cards array so that More details: I don't know why but the stack of cards (in SwingStackComponent) seems to always add new cards at the top regardless of the order of my cards array. I think when the swing component detect that my cards array has changed and there is a new element it will use createCard() (inside "swing" module) which default behavior is to add the card on top of the stack. Hopefully they've added a parameter "prepend" to it to force swing to add a card at the back of the stack. In my case it seems to work fine as i only have to push cards at the back. Hope this help. |
To keep DOM memory low I need to load cards two by two.
The process is working well when I use one card at a time, but when I want to display one draggable card and one card under the draggable one a push or unshift onto the cards array is making the new card appearing on top of the card currently dragged or on top of the second card wherein should appear under it.
Have you been able to lazy load cards at the back of the stack ?? no matter what I do the card appear at the top of the stack and it's very annoying ...
no matter if I push or unshift the next card appear on top of the existing one...
The text was updated successfully, but these errors were encountered: