Topic: Modal error - it seems in background

Mazzilli priority asked 3 years ago

Hi, I am using exactly your example code to create a modal. When I click the button to open the modal, everything is darkened, including the modal, and nothing on the screen is clickable.

What am I doing wrong?

const [basicModal, setBasicModal] = useState(false);
  const toggleShow = () => setBasicModal(!basicModal);
  return (
      <MDBBtn onClick={toggleShow}>LAUNCH DEMO MODAL</MDBBtn>
      <div>TEST CONTENT</div>
      <MDBModal show={basicModal} getOpenState={(e) => setBasicModal(e)} tabIndex='-1'>
              <MDBModalTitle>Il tuo premio!</MDBModalTitle>
              <MDBBtn className='btn-close' color='none' onClick={toggleShow}></MDBBtn>
              <p>Ecco il premio che ti sei meritato:</p>
              <MDBBtn color='secondary' onClick={toggleShow}>

Try downloading newer MDB version in the first place :) Modal has been changed and repaired several times.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: MDB5 1.0.0-beta6
  • Device: PC
  • Browser: Chrome
  • OS: Win64
  • Provided sample code: No
  • Provided link: No