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

Propagate event object to the animationEnd callback #522

Open
maybephilipp opened this issue Feb 13, 2024 · 0 comments
Open

Propagate event object to the animationEnd callback #522

maybephilipp opened this issue Feb 13, 2024 · 0 comments
Labels

Comments

@maybephilipp
Copy link

Bug report

Describe the bug

In the file: react-responsive-modal/src/index.tsx, the animationEnd handler doesn't pass original event object to the callback. What I want to solve by this is to check what caused the event and dismiss in case of wrong call. I have an issue on my website that if some animation happens inside the modal, then modal triggers this event so wrong logic is triggered. Thank you :)

    const handleAnimationEnd = () => {
      if (!open) {
        setShowPortal(false);
      }

      onAnimationEnd?.();
    };

To Reproduce

Add any finite animation inside modal. You will see that the animationEnd is triggered and no event argument is available.

Expected behavior

Original event object is passed to the callback.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • Version of react-responsive-modal: 6.4.2
  • Version of react: 18.2.0
  • Browser version: Chrome 121.0.6167.160

Additional context

Add any other context about the problem here.

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

No branches or pull requests

1 participant