Skip to content

Propagate event object to the animationEnd callback #522

@maybephilipp

Description

@maybephilipp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions