react-slide-deck icon indicating copy to clipboard operation
react-slide-deck copied to clipboard

Unable to achieve the transition effect with height CSS properties.

Open aga5tya opened this issue 8 years ago • 1 comments

@jl- First off thanks for the wonderful module.!

I have incorporated the package in a personal project of mine, but i am unable to get the transistion effect when assigning height properties in 'vh' units to the Deck parent component. I tried with other units too, like percentages, couldn't figure out.

Here's one finding i could stumble upon, when the window is resized even a little, the animation/transistions work just fine from next mousewheel action.

Additionally, im using this with server rendered nextjs framework. I quickly spun off a sample where this can be replicated. Any help is highly appreciated.

Repo

aga5tya avatar May 26 '17 13:05 aga5tya

Digging further, i see that the deck has 0 height when this.calcDimension() is fired on the componentDidMount lifecycle of Deck component. Around here.

This is because the children have not yet rendered whose height decides the Deck height post render.

For now i'm overriding the height to be 100vh on the deck component so its begins the computation on dimensions. I can create a PR, let me know if there is an other way around since mine kinda is a hacky way of fixing it. @jl-

aga5tya avatar May 27 '17 13:05 aga5tya