• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

264
Views
Cuando presiono el primer botón, el primer modal funciona. Cuando presiono el segundo botón, el segundo modal funciona

Tengo dos cuadrículas, y en cada cuadrícula tengo un botón que me gustaría tener su propio modal único. Sin embargo, cada vez que intento usar los modales de Bootstrap, solo obtengo los datos del primer botón, aunque puedo estar haciendo clic en un botón diferente que debería mostrar un modal diferente.

 import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import Modal from '@mui/material/Modal'; export default function myApp() { return( <div> <button className="mybutton" onClick={handleOpen}>Download</button> <Modal open={open} onClose={handleClose} > <Box sx={style}> <Typography id="my-modal" variant="h6" component="h2"> Download </Typography> <Typography id="my-modal" sx={{ mt: 2 }}> Duis mollis, est non commodo luctus, nisi erat porttitor ligula. </Typography> </Box> </Modal> <button className="mybutton" onClick={handleOpen}>Download</button> <Modal open={open} onClose={handleClose} > <Box sx={style}> <Typography id="my-modal" variant="h6" component="h2"> Download here </Typography> <Typography id="my-modal" sx={{ mt: 2 }}> <img src="https://wallpaperaccess.com/full/145444.jpg"/> </Typography> </Box> </Modal> </div> ) }
almost 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error