Closed ralam closed 3 years ago
@santoshyadavdev The context for this PR is, if we create a carousel that can be paged left and right, and we also allow the user to remove items from the carousel. Consider the case of a carousel containing suggestions that you can accept or reject. You can page left/right which does nothing but move, but accepting and rejecting removes the element from the carousel. We found that if you were on the last page, accepting or rejecting would remove the element from the carousel, but also somehow enable the "next page" button.
This PR aims to fix that issue.
Thanks, @ralam will get it to release on Thursday.
Check if the current slide should be the last slide when
dataStream
is updated. This fixes an issue where thedataStream
is updated but the carousel slides do not move. In the current state,isLast
will incorrectly be set to false. With these changes,isLast
will stay false if the carousel is still on the last slide after the data updates.I've tested these changes on a local application with this patch.