This pull request addresses the issue where sliders disappear when attempting to display a partial number of sliders with the adaptiveHeight property set to true. The implemented solution involves considering the slider with the slick-current classname as the current slider.
Changes made:
✅ Modified the height calculation to consider the slider marked as slick-current as the current one.
✅ Added a test that ensures partial sliders with adaptive height are displayed correctly.
Demonstrations:
Attached is a video demonstrating the issue before applying the fix.
Add an odd number of sliders greater than the unit, for example 3 slides.
In the settings, indicate that you only want to show with slidesToShow 2.5 slides, which would be 2 sliders and partially the next one. The centerMode and infinite field must be disabled.
Drag to the left slider to check that they are partially displayed.
Additional Notes:
👍 Checked that the other tests work perfectly
👍 Checked if the change of getting the current slider with slider-current affects other part of the project
Description:
This pull request addresses the issue where sliders disappear when attempting to display a partial number of sliders with the
adaptiveHeight
property set totrue
. The implemented solution involves considering the slider with theslick-current
classname as the current slider.Changes made:
✅ Modified the height calculation to consider the slider marked as
slick-current
as the current one. ✅ Added a test that ensures partial sliders with adaptive height are displayed correctly.Demonstrations:
https://github.com/akiran/react-slick/assets/16759154/2fd4d9aa-84ef-4300-a714-8a38cd8eb941
https://github.com/akiran/react-slick/assets/16759154/9665496e-0dbd-410e-9dc3-bf2a7420dcc0
How to Test the Changes:
slidesToShow
2.5 slides, which would be 2 sliders and partially the next one. ThecenterMode
andinfinite
field must be disabled.Additional Notes:
👍 Checked that the other tests work perfectly 👍 Checked if the change of getting the current slider with
slider-current
affects other part of the project