beekai-oss / react-simple-animate

🎯 React UI animation made easy
https://react-simple-animate.now.sh/
MIT License
1.82k stars 61 forks source link

Children of Animation frame are lost when their width and height defined using flex and precentage. #76

Closed MokhammadDaniyal closed 4 years ago

MokhammadDaniyal commented 4 years ago

Hello! Amazing library, but I have a problem.

When I try to animate a div that has width: 20% and flex: 1 (the parent has flex-direction: "column"), the div wrapped by animation frame gets lost. While inspection through dev tools i can see div animating but it says (div 0x0)

setting width and hight of the child as px values shows the animation.

`<AnimateKeyframes play={true} iterationCount="infinite" duration={2} keyframes={[ "transform: translateX(0px)", "transform: translateX(200px)", ]} // keyframes is an array of styles, and each style // will be distributed over 100% of the duration

<div style={{ display: "flex", flex: 1, height: "100%" }}> <div style={{ position: "absolute", flex: 1, backgroundColor: "#86c232", width: "20%", display: "block", }}

`

bluebill1049 commented 4 years ago

Can you reproduce that in a codesandbox?

bluebill1049 commented 4 years ago

will re-open once supplied with reproducible CSB.