Comments (1)
Hi @1280103995! The tl;dr; version is that you're closing the currentModal
before opening 'DefaultModal'
.
Modalfy initial purpose is to help you stack your different modals. So if you remove closeModal()
:
<Button
title={'show DefaultModal'}
onPress={() => {
- modal.closeModal()
modal.openModal('DefaultModal')
}}
/>
things should work as expected and your 'DefaultModal'
will appear on top of BottomModal
.
However if you absolutely want to open 'DefaultModal'
and not have 'BottomModal'
opened once you'll close 'DefaultModal'
, you'd have to implement a setTimeout()
. This is necessary has you have a 300ms
closing animation in 'BottomModal'
:
animateOutConfig: {
easing: Easing.bezier(0.42, -0.03, 0.27, 0.95),
duration: 300,
},
and Modalfy removes item from the stack after the animation ran. So in your case, you have:
- Button
'show DefaultModal'
is pressed 'BottomModal'
closing animation starts -t+0ms
openModal('DefaultModal')
is called'DefaultModal'
is now thecurrentModal
for Modalfy'BottomModal'
closing animation finishes -t+300ms
- Modalfy calls
closeModal()
under the hood oncurrentModal
('DefaultModal'
instead of the desired'BottomModal'
)
What you'd have to do is wait for the 300ms
animation to be completed before opening 'DefaultModal'
. By doing this you'd have both your in and out animations and 'BottomModal'
won't be opened when you'll close 'DefaultModal'
:
<Button
title={'show DefaultModal'}
onPress={() => {
modal.closeModal()
- modal.openModal('DefaultModal')
+ setTimeout(() => modal.openModal('DefaultModal'), 300)
}}
/>
Hope this helped and answered your question. I'm glad to read that Modalfy is helping you in your projects, hope to be able to see them soon in the stores! Feel free to reopen this issue if needed!
from react-native-modalfy.
Related Issues (20)
- Pass UI elements instead of Modal Name HOT 1
- There was no opened 'ModalName' modal warn HOT 1
- Modal does not animate out HOT 1
- Easy way to get modal props HOT 3
- Is it possible to check which modals are currently open before opening a modal? HOT 1
- Modal is opened again after close the first one HOT 6
- Need finish callback if noOpenedItems in queueClosingAction functions is true
- Error raised by FlingGestureHandler (react-native-gesture-handler) HOT 3
- Sending `onAnimatedValueUpdate` with no listeners registered. HOT 6
- [iOS] open modal when screen has options presentation: "modal" HOT 3
- [Android] Cannot read property 'addListener' of undefined HOT 3
- CloseModal causes an infinite loop when used as a dependency for useEffect HOT 2
- How to configure the option to close automatically (e.g. after 3000 ms) and not to close when clicking on the background? HOT 2
- RN 0.73: FlingGestureHandler must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. HOT 2
- Is it possible to make `params` non-undefined? HOT 1
- Responsive Background HOT 1
- Is it possible to pass a parameter which is a callback function to the modal? HOT 1
- Cannot select text or move cursor of TextInput inside a modal when keyboard is visible
- Closing the modal immediately after opening for the second time on Fabric
- Changing ModalOption from modal component HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-modalfy.