Rostislav pro asked 7 years ago


Good day. Please, give me advise, how to prevent modal close after mouse click on outer area?

Mighty free answered 5 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 5 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


Adrian Sawicki free answered 7 years ago


Hello Rostislav, You have to add data-backdrop="static" to your modal. Regards

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

  • ForumUser: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags