Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

310
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!