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

176
Views
Opening Dialog from ReactJS Material UI Autocomplete's rendered option from renderOption function closes autocomplete

Hello everyone I have an Autocomplete component which I am trying to add a dialog button to the options in the renderOptions functions:

<Autocomplete
  id="combo-box-demo"
  options={someOptions}
  getOptionLabel={(option) => option.title}
  style={{ width: 300 }}
  renderOptions={(option) => <span>{option.name} <Dialog /><span />}
/>

and My dialog component is:

export default function DialogDemo() {
  const [open, setOpen] = React.useState(false);
  const [selectedValue, setSelectedValue] = React.useState(emails[1]);

  const handleClickOpen = () => {
    setOpen(true);
  };

  const handleClose = (value) => {
    setOpen(false);
    setSelectedValue(value);
  };

  return (
    <div>
      <Typography variant="subtitle1">Selected: {selectedValue}</Typography>
      <br />
      <Button variant="outlined" color="primary" 
        onMouseDown={(e) => {
            e.preventDefault();
            e.stopPropagation();
          }
        }
        onClick={handleClickOpen}>
        Open simple dialog
      </Button>
      
    </div>
  );
}
about 4 years ago · Juan Pablo Isaza
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!