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

Black fill is visible during transition when using dynamicHeight and flexbox

Open remjx opened this issue 7 years ago • 18 comments

In the transition from a wide image to the tall image, a black fill is visible.

https://codesandbox.io/s/j328w994l3

In lieu of a quick solution, as a workaround, is there a way to set this background fill color?

Thanks!

remjx avatar Feb 05 '19 02:02 remjx

Hi @markjackson02, your example doesn't show the black fill. Have you tried using images instead of background?

leandrowd avatar Feb 11 '19 10:02 leandrowd

@leandrowd sorry for the late response. Here is an updated sandbox: https://codesandbox.io/s/v85v7rpn05

The black fill is visible below the smaller image during the transition.

remjx avatar Feb 26 '19 02:02 remjx

Any progress?

blacksmoke26 avatar Jun 19 '19 20:06 blacksmoke26

@blacksmoke26 @markjackson02 If I correctly understood. You may just rewrite the style of background for this selector .carousel .slide

This code is rewriting the fill color to yellow. .carousel .slide{ background: yellow; }

ghost avatar Jul 30 '19 13:07 ghost

@blacksmoke26 @markjackson02 If I correctly understood. You may just rewrite the style of background for this selector .carousel .slide

This code is rewriting the fill color to yellow. .carousel .slide{ background: yellow; }

I changed.carousel .slide{ background: black; } to.carousel .slide{ background: yellow; }in carousel.min.css but I am still getting black bars

Aeonstrife avatar Jul 30 '19 14:07 Aeonstrife

@Aeonstrife Try to open https://codesandbox.io/s/v85v7rpn05 change code in overrides.css Screenshot 2019-08-03 at 14 08 49

ghost avatar Aug 03 '19 11:08 ghost

I propose that we add background color as a prop unless there is a cleaner solution?

remjx avatar Nov 18 '19 12:11 remjx

I propose that we add background color as a prop unless there is a cleaner solution?

yes it would be nicer than overriding css classes

v1rtl avatar Jan 04 '20 10:01 v1rtl

Not sure why the default background color is black, imo, it shouldn't be set to anything

Denny966 avatar Jan 23 '20 13:01 Denny966

@Gu4etl's solution works. It looks like this https://github.com/leandrowd/react-responsive-carousel/blob/8593f0e2c7039fb502c25e80a0616dd8a532f9ec/src/components/_carousel.scss#L201 is where the black background is being set on .slide class

Does everyone agree it would make sense to add a prop for background color?

remjx avatar Apr 06 '20 17:04 remjx

+1 it should be transparent by default with the ability to change it via a prop

snjay avatar Sep 18 '20 06:09 snjay

Agreed, I think having a black background by default is unnecessarily opinionated.

+1 for slides having no background by default, and having the ability to modify the background of slides via a prop.

In case this helps anyone, the workaround I've opted for is using renderItem:

<Carousel
    renderItem={item => <div style={{ background: "white" }}>{item}</div>}
>

Alternatively, you could just override the background set on .carousel .slide.

chasinhues avatar Sep 28 '20 01:09 chasinhues

@leandrowd thanks for building this package 😃 what are your thoughts on this issue and the solutions provided?

chasinhues avatar Sep 28 '20 01:09 chasinhues

HI. Please remove that black background color.

Akbarshox avatar Oct 14 '20 14:10 Akbarshox

Any progress? Why has this not been implemented.

nick-0101 avatar Dec 20 '20 23:12 nick-0101

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 02 '21 04:07 stale[bot]

bump

remjx avatar Jul 02 '21 04:07 remjx

Still an issue, should not be closed yet!

Denny966 avatar Jul 10 '21 10:07 Denny966