[V2][iOS] ShowOverlay Modal, Action Sheet and Alert Under Problem
Issue Description
I'm creating a button for the Tab Bar using the show Overlay. It looks like top over features like Overlay Modal, ActionSheet and Alert. I've used listeners as a workaround for Modal, but I'm afraid that there will be problems in the next process. Is there a more permanent solution than a temporary solution? You can even say that if I have to write on the Native side.
Steps to Reproduce / Code Snippets / Screenshots
Navigation.showOverlay({
component: {
id: 'car.TabBarIcon',
name: 'car.TabBarIcon',
options: {
overlay: {
interceptTouchOutside: false
},
}
}
});
workaround
Navigation.events().registerCommandListener((name, params) => {
if ( ['showModal', 'dismissModal'].indexOf(name) !== -1 ) {
const isShow = name !== 'showModal'
this.setState({ isShow })
}
});
Environment
- React Native Navigation version:
2.0.2581 - React Native version:
0.57.3 - Platform(s) (iOS, Android, or both?):
iOS - Device info (Simulator/Device? OS version? Debug/Release?): Device and Simulator | iPhone6
How are you navigating between screens?
I was experiencing this as well. I was using setRoot on all screen changes, but after switching the navigation to a bottomTabs layout and navigating screens with changing currentTabId, it worked as it should, and the Alert was shown above my overlay.
I click on the Tab buttons at the bottom of the screens. So I didn't write code for that. SetRoot in BottomTab
Navigation.setRoot({
root: {
bottomTabs: {
children: [{
stack: {
children: [
{
component: {
id: 'HomeSC',
name: 'car.Home'
}
}
],
options: {
bottomTab: {
text: 'Vitrin',
icon: Home,
badge: '1'
}
}
}
}, {
stack: {
children: [
{
component: {
name: 'car.Search',
}
}
],
options: {
bottomTab: {
text: 'Arama',
icon: Search
}
}
}
}, {
stack: {
children: [
{
component: {
id: 'TabBarIconID',
name: 'car.TabBarIcon'
}
}
],
options: {
}
}
}, {
stack: {
children: [
{
component: {
name: 'car.Profile'
}
}
],
options: {
bottomTab: {
text: 'Bana Özel',
icon: Profile
}
}
}
}, {
stack: {
children: [
{
component: {
name: 'car.Settings'
}
}
],
options: {
bottomTab: {
text: 'Diğer',
icon: Settings
}
}
}
}]
}
}
});
Hey @TPMinan, I'm not sure I understand the issue. If you want to hide the button overlay, you can use a visibility listener:
Navigation.events().registerComponentDidDisappearListener(({ componentId, componentName }) => {
if (componentName === 'mainScreen') hideButtonOverlay();
});
@guyca Thank you for your answer. But that's not exactly my problem. I know these solutions that I would like to say, a fixed overlay is possible to TabBar. A Tabbar Button that can respond more healthily to ActionSheet, Modal, or Alert properties. Only if there is something like this will provide a solution. otherwise I need to check the situation with the listeners.
@guyca The problem seems to have improved when the application first tried. But once you've entered TextInput, the problem can be seen again.
<TextInput
selectionColor={'#FFC400'}
placeholderTextColor="#8E8E93"
keyboardAppearance={"dark"}
clearButtonMode={'while-editing'}
/>
@TPMinan I'm try to add the Overlay button same with your bottomTabs. But i have trouble when i'm trying to push or showModal > the Overlay Button does not hide, it's stay above all of screen (push, modal), did you have any solution to resolve this issue? Thank you very much if you can show me your solution! cc @guyca