Skip to content
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

fix(module:carousel): fix index value passed to afterchange callback #4753

Conversation

Sreekanth2108
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Index value emitted by afterChange output property when we go from either last item to first item or first item to last item is wrong.
ex:
arr = [1,2,3,4].

  • when we go from 4th element to 1st element in a circular swipe manner, the index value emitted is 4 instead of 0
  • when we go from 1st element to 4th element in a reverse circular swipe manner, the index value emitted is -1 instead of 3
    Below is the demo of the issue where active index value show the value emitted by afterChange output property
    https://angular-aacqoq.stackblitz.io
    Below is the editor to play with for the same issue
    https://stackblitz.com/edit/angular-aacqoq

What is the new behavior?

ex:
arr = [1,2,3,4].

  • when we go from 4th element to 1st element in a circular swipe manner, the index value emitted is 0 instead of 4
  • when we go from 1st element to 4th element in a reverse circular swipe manner, the index value emitted is 3 instead of -1

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

No existing test cases to modify for this change

@codecov
Copy link

codecov bot commented Feb 5, 2020

Codecov Report

Merging #4753 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4753   +/-   ##
=======================================
  Coverage   93.27%   93.27%           
=======================================
  Files         502      502           
  Lines       12679    12679           
  Branches     2011     2011           
=======================================
  Hits        11826    11826           
  Misses        443      443           
  Partials      410      410           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39487f1...cac668c. Read the comment docs.

@Laffery
Copy link
Collaborator

Laffery commented Jun 29, 2024

already fixed

@Laffery Laffery closed this Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants