instea / react-native-popup-menu

Popup menu component for React Native
ISC License
1.48k stars 248 forks source link

Menu won't show up on Android/ fine on iOS #158

Open LeoUrushi opened 5 years ago

LeoUrushi commented 5 years ago

The popup unit works fine on iOS. But it will not shop up on Android when I test it on Android simulator.

I'm looking for a up-to-date solution that works for React Native Android environment.

My app looks like this right now:

Import all the tools.

import { MenuProvider } from 'react-native-popup-menu'; import { Menu, MenuOptions, MenuOption, MenuTrigger } from 'react-native-popup-menu';

The main app looks like this. Everything is wrapped within MenuProvider.

`export class App1 extends Component { render() { return (

); } }`

This is where I built the pop-up menu. I am following example from the official tutorial.

https://github.com/instea/react-native-popup-menu

In the order of appearance, I have View> element, followed by Menu>, MenuTrigger>, MenuOptions> and MenuOption>.

`export class MoreStuff extends Component {

render(){ return (

{ //DEFINT ACTION HERE }} text='Item 1' /> { //DEFINE ACTION HERE }} text='Item 2' /> this.close}/>

);

} }`

Expected: When you click on the MenuTrigger element, the popup menu will come up. Actual result: When you click on the MenuTrigger element, nothing happens.

sodik82 commented 5 years ago

your code is somehow malformed. but I have seen your SO question and nothing apparent seems wrong. can you make simple expo snack to reproduce the problem.

however mostly the problems are if MenuProvider does not cover whole screen.

LeoUrushi commented 5 years ago

Thanks @sodik82 I just created an Expo thing. https://snack.expo.io/@leourushi/9b7f56

And the menu seems to be working in this environment. I opened my original with Android emulator running debug mode (react-native log-android). But I didn't see anything there. I can't really identify what the problem is, I'm afraid.