akiran / react-slick

React carousel component
http://react-slick.neostack.com/
MIT License
11.72k stars 2.1k forks source link

Item gets stuck off-center while scrolling vertically/diagonally #1557

Open wgolledge opened 5 years ago

wgolledge commented 5 years ago

I've spotted an issue where the item gets stuck off-center when you swipe upwards as well as horizontally.

As you can see the card gets stuck to the side when scrolling vertically as well as horizontally.

This same example can be replicated on the example given on https://react-slick.neostack.com/ - though it's harder to notice because of the lack of padding.

Expected outcome:

The card should bounce back to the center, as it normally does, when swiping vertically combined with horizontally.

Kshinight commented 4 years ago

have same problem

edwardfxiao commented 4 years ago

Same problem here with the official demo https://codesandbox.io/s/react-slick-playground-kdme2

ezgif-6-561d25e6e83e

The trick to reproduce this issue is dragging an item and instantly releasing the mouse once the left item appears.

edwardfxiao commented 4 years ago

ok, found the solution. Just wrap one more div to the tag.

original code

<Slider {...settings}>
          <div>
            <img src="http://placekitten.com/g/400/200" />
          </div>

working code:

<Slider {...settings}>
          <div>
            <div>
              <img src="http://placekitten.com/g/400/200" />
            </div>
          </div>
wgolledge commented 4 years ago

Nice spot. Strange bug

sandeepdhobi commented 4 years ago

strange , working for me as well , thanks

kwanso-hassanlatif commented 1 year ago

not working