ng2-swipe-cards icon indicating copy to clipboard operation
ng2-swipe-cards copied to clipboard

Removing cards using this.cards.shift() is causing issue on swipe effect on tapping like/dislike button

Open gauravparmar opened this issue 7 years ago • 2 comments

Removing cards using this.cards.shift() is causing issue on swipe effect on tapping like/dislike button. I am loading 3 cards initially and then removing cards one by one on swiping using this.cards.shift() and also pushing a card on each removal using this.cards.push(....). Also instead of using cardCursor, I am always removing card at 0th index and adding one card at the end(Index 2) at the same time on swiping. After using .shift() method, when we try to swipe the card then the swipe effect works but when we use like/dislike button then the swipe effect is not getting shown and the card is getting removed abruptly with no effect. What could be the possible reason? And thanks a lot for such a nice module.

gauravparmar avatar Jan 31 '18 14:01 gauravparmar

Fire the like event on the card before shifting your stack: card.likeEvent.emit({ like });

Sjerd avatar Apr 17 '18 11:04 Sjerd

what is card in the above line @Sjerd. Is it the viewchild of sc-card?

ravimail26 avatar Oct 03 '18 11:10 ravimail26