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

Customize dropdown container #7

Closed
ghost opened this issue Sep 26, 2018 · 6 comments
Closed

Customize dropdown container #7

ghost opened this issue Sep 26, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Sep 26, 2018

It is not possible to add any styles or classes to the very first wrapper of dropdown menu. I`m having an issue, when I need to change menu zIndex, because it is hidden by page contents

@Macil
Copy link
Collaborator

Macil commented Sep 26, 2018

Is it SubMenuItem that you're using? Did you try its menuZIndex prop?

@ghost
Copy link
Author

ghost commented Sep 26, 2018

Dropdown or MenuList whatever it is, the first div with absolute coordinates for menu

@Macil
Copy link
Collaborator

Macil commented Sep 26, 2018

The Dropdown component is meant to be used with SubMenuItem or MenuButton (which both use react-float-anchor to create a floating element with a z-index property for the Dropdown to be rendered into). Dropdown isn't meant to be used on its own.

@ghost
Copy link
Author

ghost commented Sep 26, 2018

The following screenshot shows div which I need to customize

selection_118

I`m rendering menu this way, and it works
On which component should I add your prop?

renderMenu(menu) {
    return <Dropdown>
      <MenuList>
        {
          menu.map(item => item.children ? this.renderSubmenu(item) : this.renderMenuItem(item))
        }
      </MenuList>
    </Dropdown>;
  }

  renderSubmenu(submenu) {
    return <SubMenuItem key={submenu.id}>
      // children
    </SubMenuItem>;
  }

  renderMenuItem(item) {
    return <MenuItem key={item.id}>
      // children
    </MenuItem>;
  }

I`m having multilevel menu

@Macil
Copy link
Collaborator

Macil commented Sep 26, 2018

What component is that element?

Only MenuButton and SubMenuItem contain an element with position:fixed if I remember right, so if that element is a react-menu-list component, I assume it's one of those. You can use the menuZIndex prop on those.

@Macil Macil closed this as completed Oct 3, 2018
@Macil
Copy link
Collaborator

Macil commented Oct 3, 2018

I'm closing the issue because I don't believe there's a problem with react-menu-list here. Feel free to reply if you still need help.

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

No branches or pull requests

1 participant