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(issue180): handling invalid clickedIndex in carousel.js #187

Merged
merged 3 commits into from
Oct 6, 2021
Merged

fix(issue180): handling invalid clickedIndex in carousel.js #187

merged 3 commits into from
Oct 6, 2021

Conversation

LoganTann
Copy link

@LoganTann LoganTann commented Sep 15, 2021

In the carousel, navigating by clicking :

  • at right when the selected item is the last
  • at left when the selected item is the first
    causes the clickedIndex to be invalid and breaks the component.

Proposed changes

Solves #180 (and also Dogfalo#6459), all changes are explained here

Screenshots (if appropriate) or codepen:

see Dogfalo#6459 (comment)

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • one Typo fix in the file, and automatic lint from vscode (I couldn't control that...)

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I didn't tested nor created test because :

  • using yarn test --verbose --filter=carousel took way too much time in my laptop.
  • handling precise click events are a bit difficult in jasmine

js/carousel.js Outdated Show resolved Hide resolved
@cmcknight
Copy link

cmcknight commented Sep 18, 2021 via email

@DanielRuf
Copy link

Please see the failing commitlint check. We use commitlint-conventional: https://github.com/conventional-changelog/commitlint#what-is-commitlint

So something like fix: hnadle invalid ... (wiithout a dot at the end) should pass this check.

In the carousel, navigating by clicking :
 - at right when the selected item is the last
 - at left when the selected item is the first
causes the clickedIndex to be invalid and breaks the component.
@LoganTann LoganTann changed the title fix (#180): Handling invalid clickedIndex in carousel.js:_handleCarousel() fix(issue180): handling invalid clickedIndex in carousel.js Oct 3, 2021
… modified by my code editor

this commit applies this review comment :
#187 (comment)
…rt of the code fixes

this commit applies this review comment :
#187 (comment)
Copy link
Author

@LoganTann LoganTann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awaiting approval

@DanielRuf DanielRuf requested review from wuda-io, RamonvdW and a team October 5, 2021 21:20
Copy link
Member

@wuda-io wuda-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Smankusors Smankusors merged commit c9fa76d into materializecss:main Oct 6, 2021
@Smankusors
Copy link
Member

Sorry, I took too long to review, thanks for the PR and everyone that reviewed this PR 👍

Anyway, I sent an invitation to you to join the @materializecss/members team. Welcome 🎉

@LoganTann LoganTann deleted the fix-issue180-carousel branch October 6, 2021 23:42
@Smankusors Smankusors added the bug Something isn't working label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants