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

120
Vistas
Popup opening when you click on the text in the menu

I have a ready popup. But I only want it to open when I click on the "Send my policy to my email address" item in the menu. How can I do it?

<AS.Menu
  id="long-menu"
  MenuListProps={{
    'aria-labelledby': 'long-button',
  }}
  anchorEl={anchorEl}
  open={open}
  onClose={handleClose}
>
  {[
    'View PDF',  // Menu item
    'Send my policy to my email address', // Menu item
    'Cancel my policy', // Menu item
    ].map((option) => (
    <AS.MenuItem key={option} onClick={handleClose}>
      {option}
    </AS.MenuItem>
  ))}
</AS.Menu>

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

One of the options would be to pass the clicked option to the handleClose method, something like the below:

<AS.Menu
  id="long-menu"
  MenuListProps={{
    'aria-labelledby': 'long-button',
  }}
  anchorEl={anchorEl}
  open={open}
  onClose={handleClose}
>
  {[
    'View PDF',  // Menu item
    'Send my policy to my email address', // Menu item
    'Cancel my policy', // Menu item
    ].map((option) => (
    <AS.MenuItem key={option} onClick={() => handleClose(option)}>
      {option}
    </AS.MenuItem>
  ))}
</AS.Menu>

Then, In the handleClose method you can validate whether the clicked option was the one you want:

const handleClose = (option) => {
  if (option === 'Send my policy to my email address') showPopup();
}
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