Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popup-menu does not work on android in DEV mode #41

Closed
binbinla opened this issue Aug 28, 2017 · 12 comments
Closed

popup-menu does not work on android in DEV mode #41

binbinla opened this issue Aug 28, 2017 · 12 comments

Comments

@binbinla
Copy link

I can't see the menu on android device,while iOS can.

@sodik82
Copy link
Contributor

sodik82 commented Aug 28, 2017

can you provide us more details?

@sodik82
Copy link
Contributor

sodik82 commented Sep 16, 2017

closing due to inactivity. official example works fine on android.

@sodik82 sodik82 closed this as completed Sep 16, 2017
@joncursi
Copy link

I'm having the same issue. iOS menus are opening, android menus are not. I'm using the slide renderer that comes in from the bottom

@sodik82
Copy link
Contributor

sodik82 commented Sep 23, 2017

can you provide us more details? ideally provide us "not working" expo snack example that we can reproduce the problem. Or if you can track what in your setup caused the bad behaviour - since our example application works fine with slideIn renderer. Is it same for different versions of RN? Or maybe if you could send us the debug logs (Menu.debug = true;)

@sodik82 sodik82 reopened this Sep 23, 2017
@joncursi
Copy link

I think it has something to do with whether or not Android is being bundled and / or minified in debug versus release mode. I'll see if I can narrow it down to something more concrete

@joncursi
Copy link

joncursi commented Sep 25, 2017

Okay, I have reproducible behavior:

If react-native's global __DEV__ variable is set to true, none of my popup menus open when I press the menu trigger (only on Android, iOS seems to work fine regardless of DEV setting). For my staging and release builds, where __DEV__ is set to false, all menus open correctly when pressing the menu trigger.

@sodik82
Copy link
Contributor

sodik82 commented Sep 25, 2017

thanks, so it should be something with debug mode. Just to be sure - which RN version? I will try to check it sometime this week.

@joncursi
Copy link

@sodik82 sounds good! I'm on the latest (0.48.4) but I was also seeing this on 0.48.3.

@sodik82
Copy link
Contributor

sodik82 commented Sep 25, 2017

@joncursi I tried our basic example on clean RN 0.48.4 project on Android simulator in debug mode. ( __DEV__ was true. ) But it was working. Have you seen something suspicious in RN logs (ideally with Menu.debug=true)? Or do you have any 3rd party lib above MenuContext?

@sodik82 sodik82 changed the title why popup-menu can't use on android device popup-menu does not work on android in DEV mode Sep 27, 2017
@sodik82
Copy link
Contributor

sodik82 commented Oct 23, 2017

closing for inactivity - will reopen if there is new info.

@sodik82 sodik82 closed this as completed Oct 23, 2017
@joncursi
Copy link

@sodik82 I finally figured it out!

I am using a Symbol polyfill from core-js on Android because a lot of the libraries that I use depend on it. It seems like this causes some trouble with other libraries, such as this one.

Try npm install --save core-js and then adding this to your android.index.js:

import 'core-js/es6/symbol';
import 'core-js/fn/symbol/iterator';

You'll see that the popup menus no longer open. However, if you enable "Debug JS Remotely", they work again. That is because the JS gets executed on your laptop instead, which supports Symbol natively.

What can we do to fix this? Check out this comment and the associated PR to see what they did to fix this same issue with the BackHandler module.

@sodik82 sodik82 reopened this Oct 30, 2017
@sodik82
Copy link
Contributor

sodik82 commented Oct 31, 2017

I have worked around the problem with iterator and polyfills - thus menu should open. I guess in such setups our BackHandler implementation won't work - but this is outside of our reach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants