We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
@lazarus2019 I created a helper function to help with this, changing the preserveAspectRatio attribute helped with the lottie size on resize:
preserveAspectRatio
import { LottieContainer } from "./constants"; export const svgHelper = () => { const lottie = document.getElementsByClassName( LottieContainer )[0] as HTMLDivElement; const svg = lottie.getElementsByTagName("svg")[0]; if (svg) { svg.setAttribute("preserveAspectRatio", "xMidYMid slice"); } };
Then I just call it inside a useEffect:
useEffect(() => { svgHelper(); }, []);
Works for me
Sorry, something went wrong.
@lazarus2019 looking at it now, looks like you can use the renderSettings prop on the <Lottie /> component:
renderSettings
<Lottie />
<Lottie lottieRef={lottieRef} animationData={scrollLottieReveal} autoplay={false} rendererSettings={{ preserveAspectRatio: "xMidYMid slice", }} />
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: