Preventing modal to close

Rostislav pro asked 8 years ago

Good day. Please, give me advise, how to prevent modal close after mouse click on outer area?
Hello Rostislav, You have to add data-backdrop="static" to your modal. Regards

Mighty answered 6 years ago

b-modal id="modalInfo" data-backdrop="static" @hide="resetModal" :title="modalInfo.title" ok-only

     pre{{ modalInfo.content }}/pre

/b-modal

I did that but it's not working.

I added these <> but it seems the platform does not allow me to send tags in my complaints.


Jakub Strebeyko staff commented 6 years ago

Hi there @Mighty,

To submit snippets, please use dedicated syntax by clicking the "101010" button (the fifth one on the button panel above the textarea) or by hitting cntrl+k, Stack Overflow style.

Your code looks awful lot like Vue and this is a two years old jQuery thread. MDBVue components do not utilize data-attributes; they use props instead. The removeBackdrop prop removes the clickable background overlay, making it so clicking outside does not cause the modal to close. For additional info, please refer to the official MDBVue modal docs, API section.

For future reference, tickets get served better when they are properly labeled, not resurrected. In worst case scenario, they'll get marked as duplicate, but still solved.

With Best Regards, Kuba


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No