react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[V2][iOS] ShowOverlay Modal, Action Sheet and Alert Under Problem

Open m-inan opened this issue 8 years ago • 6 comments

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
         },
      }
   }
});
screen shot 2018-10-16 at 16 15 03 screen shot 2018-10-16 at 16 14 43 screen shot 2018-10-16 at 16 14 00

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

m-inan avatar Oct 16 '18 13:10 m-inan

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.

michellmorso avatar Oct 16 '18 19:10 michellmorso

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
                                }
                            }
                        }
                    }]
                }
            }
        });

m-inan avatar Oct 16 '18 22:10 m-inan

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 avatar Oct 21 '18 07:10 guyca

@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.

m-inan avatar Oct 21 '18 21:10 m-inan

@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'}
/>

m-inan avatar Nov 13 '18 08:11 m-inan

@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

kentdev92 avatar Jun 03 '19 00:06 kentdev92