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

Multiple menus, one not showing.

Open mrdja026 opened this issue 7 years ago • 3 comments

Hi, i have two menus, Lets say Primary: Option 1 - click on this Opens SecondaryMenu Option 2

Secondary Menu Option 2.1 Option 2.2

at first it works Secondary Menu is opened with simple this.secondaryMenu.open(); after closing secondary menu, and trying again (opening primary menu, and selecting Option 1), secondary menu onOpen method invokes but nothing is displayed on the screen?

hope this helps: https://snack.expo.io/Bk9qbUetz After playing around what i have found that, if i have one menu, that opens other menus via some MenuOption interaction, if the parent and child (in lack of better word) have the same renderer property, child menu wont be visible. Is this expected behavior?

Will provide more info if needed.

mrdja026 avatar Mar 09 '18 17:03 mrdja026

Hi there, thank you for the example.

Our library has "design restriction" that only one menu can be opened at a time. It seems that "something" went wrong with concurrent closing and opening :) - as they are not instant operations.

Workaround around it is to explicitly wait for closing of first menu and then open the second. Unfortunately that is only possible via MenuProvider API currently - I will allow it also for menus in next release.

So working solution would look like:

  showSecondary = () => {
    this.provider.closeMenu()
      .then(() => this.provider.openMenu('secondary'))
  }

sodik82 avatar Mar 12 '18 15:03 sodik82

image

any idea? let me solution?

isthaison avatar Jun 22 '18 08:06 isthaison

@isthaison currently it is not possible. only option is to write your own menu renderer.

sodik82 avatar Jun 22 '18 18:06 sodik82