question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Closing modal doesn't animate out, closes instantly after duration

See original GitHub issue

When calling closeModal(), the closing animation never happens. It waits the amount of time of the duration, then instantly closes. I’ve tested this by setting the duration to 3 seconds… there is no visible transition happening when closing.

This problem however doesn’t exist on openModal(), which works fine.

  const defaultOptions: ModalOptions = {
    backdropOpacity: 0.9,
    disableFlingGesture: true,
    animateInConfig: {
      easing: Easing.inOut(Easing.exp),
      duration: 3000,
    },
    animateOutConfig: {
      easing: Easing.inOut(Easing.exp),
      duration: 3000,
    }
  }

Any ideas?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
CharlesMangwacommented, Apr 27, 2022

Hi @tp26610! Please simply update your project to v3.2.0, that issue has already been fixed there:

https://user-images.githubusercontent.com/8975443/165439754-a31eec74-003d-47a4-9cba-103425be7e3d.mov

1reaction
tp26610commented, Apr 8, 2022

Hi, @CharlesMangwa

I’ve reproduced the issue while calling closeModal.

The video is showing that animation doesn’t work while calling closeModal and the animation works while user clicks background to dismiss the modal.

The code is here: https://snack.expo.dev/@tp26610/react-native-modalfy

https://user-images.githubusercontent.com/9457401/162485480-6b794759-87a2-43c5-bdbe-2467a0cdc6fc.mov

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript Modal Animation not Working When Close
The "out" animation has to work in the reverse order. First you have to animate the modal out. Whenever the animation is finished...
Read more >
Modal - Bootstrap
Clicking on the modal “backdrop” will automatically close the modal. Bootstrap only supports one modal window at a time. Nested modals aren't supported...
Read more >
How to Close a React Native Modal with a Button - CodeProject
Add a close button to a React Native and close the modal by clicking beside it.
Read more >
Animated Modals with Framer Motion - Fireship
div component that fades in and out. It takes the onClick prop to close the modal when the backdrop is clicked. components/Backdrop/index.
Read more >
react-native-modal - npm
An enhanced, animated, customizable React Native modal. ... if you want to immediately show a new modal after closing one you must first ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found