Closing modal doesn't animate out, closes instantly after duration
See original GitHub issueIssue Description
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:
- Created 2 years ago
- Comments:20 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
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