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

fix confetti bug #446

Closed
wants to merge 8 commits into from
Closed

fix confetti bug #446

wants to merge 8 commits into from

Conversation

andrecasal
Copy link
Contributor

This fixes a bug with the Confetti component: if you resize the window, the Confetti component keeps occupying the original width and height, creating vertical and horizontal scrolling.

Video showing the issue: https://youtu.be/G2d8-KYU7j0

Changes:

  • Add useWindowSize()
  • Add useIsomorphicLayoutEffect()
  • Add useEventListener()
  • useWindowSize() on the Confetti component to respond to resizing events.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would much rather have this be fixed in confetti-react. Could you make a PR over there?

@kentcdodds
Copy link
Member

Also, thanks!

@andrecasal
Copy link
Contributor Author

You're welcome! I'll give it a try.

@andrecasal andrecasal closed this Sep 15, 2023
@andrecasal
Copy link
Contributor Author

andrecasal commented Sep 15, 2023

Well, the last update was on May 20, 2022. I'll fork and fix it. I'll post the new version here.

There's also another bug related to viewport width: when the confetti animation is launched, if you scroll, the confetti will disappear, which I think is solved using the same solution.

@andrecasal andrecasal reopened this Sep 15, 2023
@kentcdodds
Copy link
Member

Closing this until a new package is ready. Thanks!

@kentcdodds kentcdodds closed this Sep 29, 2023
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

Successfully merging this pull request may close these issues.

2 participants