react-responsive-modal icon indicating copy to clipboard operation
react-responsive-modal copied to clipboard

Propagate event object to the animationEnd callback

Open maybephilipp opened this issue 4 months ago • 0 comments

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.

maybephilipp avatar Feb 13 '24 15:02 maybephilipp