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(DialogBase): Don't trigger the hide animation on strict mode #375

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

HenriqueLimas
Copy link
Member

Description

  • Change to use a previousOpen value to make sure we show the hide animation only when it changes.
  • Add StrictMode to storybook

Context

The previous logic was checking if it was the first render, but on StrictMode the layout effect is executed twice, triggering the hide animation logic during development.

@HenriqueLimas HenriqueLimas added the bug Something isn't working label Nov 2, 2024
@HenriqueLimas HenriqueLimas self-assigned this Nov 2, 2024
@oxala
Copy link
Contributor

oxala commented Nov 2, 2024

Sweet, thanks!

Copy link
Contributor

@shpandian shpandian left a comment

Choose a reason for hiding this comment

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

LGTM

@HenriqueLimas HenriqueLimas merged commit d201e5e into main Nov 4, 2024
6 checks passed
@HenriqueLimas HenriqueLimas deleted the hlimas/fix-strict-mode-dialog branch November 4, 2024 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants