react-native-popup-menu icon indicating copy to clipboard operation
react-native-popup-menu copied to clipboard

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

Open LeoUrushi opened this issue 5 years ago • 2 comments

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 ( <MenuProvider> <View style={styles.container}> <MoreStuff navigation={this.props.navigation} /> <TopMenu1 navigation={this.props.navigation} /> <View1Map /> </View> </MenuProvider> ); } }

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 ( <View>

onSelect={() => { //DEFINT ACTION HERE }} text='Item 1' /> <MenuOption onSelect={() => { //DEFINE ACTION HERE }} text='Item 2' /> <MenuOption text='Close'

onSelect={() => 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.

LeoUrushi avatar May 22 '19 17:05 LeoUrushi

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.

sodik82 avatar May 22 '19 19:05 sodik82

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.

LeoUrushi avatar May 25 '19 09:05 LeoUrushi