react-multi-carousel icon indicating copy to clipboard operation
react-multi-carousel copied to clipboard

add partialGutter to centerMode

Open schoenwaldnils opened this issue 3 years ago • 8 comments

should help with #160 #186

I'm not 100% sure if this breakes on some other points. Please test and review :)

schoenwaldnils avatar Feb 14 '22 11:02 schoenwaldnils

Guys, I tried to add partialGutter with center mode, but doesn't seem to work for me.

is there any possible way to create this kind of slider with the help of centerMode, I mean can I set the left and right peeks values according to me,, like how much i want to show the peeks from sides Screenshot 2022-03-25 171613

This should be possible with this PR

example config:

const responsive = {
  desktop: {
    breakpoint: { max: 3000, min: 1024 },
    items: 3,
    partialVisibilityGutter: 40,
  },
  tablet: {
    breakpoint: { max: 1024, min: 464 },
    items: 2,
    partialVisibilityGutter: 30,
  },
  mobile: {
    breakpoint: { max: 464, min: 0 },
    items: 1,
    partialVisibilityGutter: 30,
  }
}
<Carousel partialVisible centerMode responsive={responsive}>
  <ItemOne />
  <ItemTwo />
</Carousel>

(the combination of partialVisible an centerMode throws an error without this PR)

schoenwaldnils avatar Mar 25 '22 11:03 schoenwaldnils

@YIZHUANG I'm not entirely sure if my calculation is wrong or the CI checks needs to be updated. Visually it looks good to me. Can you look into it?

schoenwaldnils avatar Mar 25 '22 12:03 schoenwaldnils

Guys, I tried to add partialGutter with center mode, but doesn't seem to work for me. is there any possible way to create this kind of slider with the help of centerMode, I mean can I set the left and right peeks values according to me,, like how much i want to show the peeks from sides Screenshot 2022-03-25 171613

This should be possible with this PR

example config:

const responsive = {
  desktop: {
    breakpoint: { max: 3000, min: 1024 },
    items: 3,
    partialVisibilityGutter: 40,
  },
  tablet: {
    breakpoint: { max: 1024, min: 464 },
    items: 2,
    partialVisibilityGutter: 30,
  },
  mobile: {
    breakpoint: { max: 464, min: 0 },
    items: 1,
    partialVisibilityGutter: 30,
  }
}
<Carousel partialVisible centerMode responsive={responsive}>
  <ItemOne />
  <ItemTwo />
</Carousel>

(the combination of partialVisible an centerMode throws an error without this PR)

Okay, I am eagerly waiting for this functionality, do you have any idea when this PR is going to merge?

mahabeer avatar Mar 25 '22 16:03 mahabeer

Sorry, i will find time and take a look

YIZHUANG avatar Apr 19 '22 08:04 YIZHUANG

@mahabeer @schoenwaldnils To make this release smoother would you help test the existing behaviours are still working? And please also let me know how you tested the changes as well.

YIZHUANG avatar Apr 19 '22 14:04 YIZHUANG

@YIZHUANG @schoenwaldnils any update on this PR?

I'll be glad to help on the PR as this is a needed feature for me.

vickywane avatar Aug 23 '22 09:08 vickywane

@YIZHUANG do you have any idea when this one could be merged? Or do you need any help?

agatakozinska avatar Sep 21 '22 13:09 agatakozinska

I would very much like to see this feature merged in and a new release cut.

johncastorina avatar Dec 27 '23 19:12 johncastorina