React-slick: Can't click to next or previous slide if fade is `true` and infinite is `false`

Created on 28 Aug 2020  Â·  4Comments  Â·  Source: akiran/react-slick

Can't click next or previous button

If the setting option components like ...

const setting = {
  fade: true,
  infinite: false,
}

You can only click the next slide button from the first slide to the second slide. In addition, you will found it can't click the next slide after the second slide.

In the example, I add option dots: true for giving to test.
_(Dots is working, but button isn't work)_

Example:
https://codesandbox.io/s/react-slick-playground-forked-fd3j4?file=/index.js

bug

All 4 comments

@akiran this seems to be due to a piece of code you added recently here.

if (!infinite) { targetSlide = previousTargetSlide + slidesToScroll; }

Would be helpful if you add the bug id in your commit messages, so the reason for the fix becomes apparent. Do you plan to revert the fix or at least could you post the ticket for why this fix was added ? LMK.

@gautamz07 That fix is to make slide navigation with keyboard arrows work.

@akiran ,

investigated this issue is bit , any obvious reason why you decided to use targetSlide: previousTargetSlide instead of just using currentSlide , which is already being reliably used in the changeSlide function ?

using currentSlide seems to get the functionality back on track.

If you have a commit id for this change you introduced and the commit fixes 1 specific issue only , I can create a PR with a git revert commit and add the change. let me know.

No need to revert.

Please create a new PR with the fix

On Wed, 2 Sep 2020 at 1:10 AM, gautamz07 notifications@github.com wrote:

>
>

@akiran https://github.com/akiran ,

investigated this issue is bit , any obvious reason why you decided to use targetSlide:
previousTargetSlide instead of just using currentSlide , which is already
being reliably used in the changeSlide function ?

using currentSlide seems to get the functionality back on track.

If you have a commit id for this change you introduced and the commit
fixes 1 specific issue only , I can create a PR with a git revert commit
and add the change. let me know.

—
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/akiran/react-slick/issues/1881#issuecomment-685090719,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAZ64H5DAQFC3MB5SYH52FLSDVE4PANCNFSM4QN6R2MQ
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rohitgoyal7 picture rohitgoyal7  Â·  3Comments

walker-jiang picture walker-jiang  Â·  3Comments

adamthewan picture adamthewan  Â·  4Comments

vugman picture vugman  Â·  3Comments

ramyatrouny picture ramyatrouny  Â·  3Comments