Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

314
Visualizações
Nested menu using Material UI (4.9.2) - React Js (16.8.5)

I am trying to create nested menu using Material UI, without any third party packages.

What I have Done:

  • Created a menu and menu items.
  • One of the menu item added a button.
  • Opens another menu with menu item.

It is fine functionally, messy but functional.

Code:

    <Button 
            aria-controls="fade-menu" 
            aria-haspopup="true" 
            onClick={handleClick} >  
            EU <ArrowDropDown />
    </Button>
 <Menu
        id="fade-menu"
        anchorEl={anchorEl}
        keepMounted
        open={open}
        onClose={handleClose}
      >
{Object.keys(SETTING).map((key: string) => {
    <MenuItem
            key={key}
            onClick={onChange(key)}
            selected={isSelected}>
                 <Button // want this button to be hidden, but functional.
                    aria-controls="fade-menu"
                    aria-haspopup="true"
                    onClick={handleSubClick}
                  >
                   <ArrowDropDown />
                 </Button>
              <Menu
                    id="fade-menu"
                    aria-controls="fade-menu"
                    aria-haspopup="true"
                    anchorEl={subAnchorEl}
                    keepMounted
                    open={subOpen}
                    getContentAnchorEl={null}
                    anchorOrigin={{ vertical: "bottom", horizontal: 120 }}
                    transformOrigin={{ vertical: "top", horizontal: "center" }}
                    onClose={handleSubClose}
                    className={subMenu}
             >
     {Object.keys(euCountries).map((keyId: string) => (
                       <MenuItem
                          key={key}
                          onClick={onChange(keyId,true)}
                          selected={path[type] === keyId}>
                             UK 
                       </MenuItem>))}
                </Menu>
                  
    </MenuItem>
    )})}
</Menu>

The Problem:

I need this button with arrow down icon, integrated with the menu Item itself.

The output

Other than using third party packages, any work around is accepted. Like CSS changes or another child component etc.

Edit:

I want the output to look like this. Output I need

Instead I am gettting this. Output I get

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I believe material ui buttons have the startIcon and endIcon tag, no?

For instance:

<Button endIcon={<ArrowDropDown/>} ></Button>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda