Adjust modal size and native-stack onDismissed
See original GitHub issueI use this package with react-navigation
V5.
I suggest to add an option to customize the height of the modal screen.
Besides, I currently use this code to popToTop:
const unsubscribe = navigation.addListener('dismiss', () => {
navigation.popToTop();
});
return unsubscribe;
}, [navigation]);
When I swipe down to dismiss the modal, it won’t directly popToTop
.
I know that this package has a onDismissed
prop and I want it to execute navigation.popToTop();
.
However, I can’t find a way to implement this with createNativeStackNavigator()
and errors occur.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Set width and height to React-native modal
According to the Modal documentation, there is no style prop to be set. You can try setting the <View> dimensions inside the <Modal>...
Read more >Opening a modal
To change the type of transition on a stack navigator you can use the presentation option. When set to modal , all modal...
Read more >Modal
The onDismiss prop allows passing a function that will be called once the modal has been dismissed. Type. function. onOrientationChange. iOS. .
Read more >Modal
Modal | NativeBase | Universal Components for React and React Native ; isOpen. If true, the modal will open. Useful for controllable state...
Read more >Modal · Bootstrap
Modals are built with HTML, CSS, and JavaScript. They're positioned over everything else in the document and remove scroll from the <body> so...
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 FreeTop 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
Top GitHub Comments
Because the
native-stack
does not have such prop. It is a property of aScreen
component and is used bynative-stack
to trigger navigation actions of dismissing a screen and emitting navigation event ‘dismiss’. https://github.com/software-mansion/react-native-screens/blob/master/src/native-stack/views/NativeStackView.tsx#L96 you can see that it calls ‘pop’ action. If you want your own action there, you could overwrite this behavior for e.g.stackPresentation: 'modal'
.This behavior won’t be changed to what you would want because it would result in every dismiss to pop the whole stack, which does not make sense in most cases.