react-slick icon indicating copy to clipboard operation
react-slick copied to clipboard

Fix adaptive height when multiple slides are visible

Open Poky85 opened this issue 7 years ago • 12 comments

Issue When multiple slides are visible and adaptiveHeight is turned on, then slider's height is calculated from first visible slide only.

Desired behavior Slider height should be calculated as max. height of all slides visible.

How to reproduce problem:

var settings = {
  infinite: true,
  // Multiple slides visible
  slidesToShow: 3,
  slidesToScroll: 1,
  // Slider height is adaptive (set dynamically based on content height)
  adaptiveHeight: true
};

return (
  <Slider {...settings}>
      <div>
        <h3>1</h3>
      </div>
      <div>
        <h3>2</h3>
        <p>Hello</p>
      </div>
      <div>
        <h3>3</h3>
        <p>See ....</p>
        <p>Height is adaptive</p>
      </div>
  </Slider>;
);

Poky85 avatar Oct 24 '18 19:10 Poky85

@akiran May I ask you for a review so we can fix this bug?

Poky85 avatar Nov 13 '18 18:11 Poky85

This works for me. Thanks @Poky85

Added to npm

Anyone who wants this yarn add react-slick-adaptive-height-fixed then find/replace in project: react-slick with react-slick-adaptive-height-fixed

corysimmons avatar Apr 02 '19 14:04 corysimmons

Works for me as well. When could we expect a review on this issue ?

studnik18 avatar Jul 09 '19 07:07 studnik18

Any updates on this?

salzig avatar Jul 15 '19 12:07 salzig

Also have this annoying issue, can we merge please????

Screen Shot 2019-09-05 at 10 35 50 am

samturner3 avatar Sep 05 '19 00:09 samturner3

@Poky85 I installed react-slick-adaptive-height-fixed, but there is still a bug on the last slide of the slider when infinite = true.

Sep-13-2019 15-00-42

Slider settings:

  slidesToShow: 2,
  slidesToScroll: 2,
  adaptiveHeight: true,
  dots: false,
  arrows: false,
  infinite: true,
  speed: 500,

samturner3 avatar Sep 13 '19 05:09 samturner3

afaik react-slick-ad-height-fixed is a patched version.

salzig avatar Sep 13 '19 13:09 salzig

afaik react-slick-ad-height-fixed is a patched version.

Correct, I am reporting a bug in the patched version. Without the patch the problem is much worse 😢

samturner3 avatar Sep 15 '19 23:09 samturner3

Correct, I am reporting a bug in the patched version. Without the patch the problem is much worse 😢

there is two patched versions, react-slick-adaptive-height-fixed and react-slick-ad-height-fixed, you talked only about the first one, did you try the later?

salzig avatar Sep 16 '19 05:09 salzig

Could this please be merged?

DanielLowe1993 avatar Jun 04 '20 13:06 DanielLowe1993

Waiting for the merge!

damechen avatar Apr 12 '21 23:04 damechen

waiting for merge in 2023 😂

firstpersoncode avatar Nov 20 '23 17:11 firstpersoncode