Open eikawata opened 3 months ago
I'm not sure how problematic to always set shouldCorrectItemPosition
to true by default since the comment mentions that it is "already taken care of". But, in that case, could we expose a new option which always sets it to true? That would be a safer fix.
I'm probably willing to make a pull request, so please let me know.
Prerequisite Done!
Describe the bug
infinite
mode is off and the carousel is not in the first slide (i.e. the next arrow was pressed at least once), then the width of the cards are not updated untilcomponentDidUpdate
ofCarousel.js
runs.To Reproduce Steps to reproduce the behavior:
Expected behavior The width of the cards are all update as the window is resized.
Screenshots The width of the cards are updated correctly only after a short delay. It suddenly "snaps" into the correct width which looks very weird.
This does not happen when the
infinite
mode is on.When the carousel is at the end of the slides, then updating the card widths looks completely broken.
Additional context This is where the problem is in the code. The
shouldCorrectItemPosition
is always false unless theinfinite
option is true.Carousel.js
Shouldn't we always do the resize regardless of the
infinite
?Reproduction This can be reproduced in the Storybook's "Without infinite mode".