Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

311
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda