Skip to content
New issue

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

Confetti Impacts Scrollbar / Window Height + Width #34

Open
WilliamTomOBrien opened this issue Dec 16, 2021 · 1 comment
Open

Confetti Impacts Scrollbar / Window Height + Width #34

WilliamTomOBrien opened this issue Dec 16, 2021 · 1 comment

Comments

@WilliamTomOBrien
Copy link

When using the demo for this library, activating the confetti effect with default settings causes the window size to change due to confetti elements only being de-rendered when the time of the animation is complete, which in turn causes a new scrollbar to be added for the width of the window, and changes the height scrollbar as well (as the height increases).

As a developer I want the ability to prevent this from happening so that users of the application I am working on are not negatively impacted.

@im6
Copy link

im6 commented Aug 21, 2022

const oldOverflowValue = document.body.style.overflow;
document.body.style.overflow = "hidden";
confetti(document.getElementById("canvas")).then(() => {
  document.body.style.overflow = oldOverflowValue;
});

this should help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants