Topic: Modals - Ability to Prevent Close on Click of Backdrop

Elliot pro asked 5 years ago


Right now if I click anywhere outside the modal it will close the modal. It would be nice if we had the ability to prevent close on click outside and require user to click the close button.

Mighty free answered 3 years ago


Please how do i solve this same issue in vue js? How do i add the attribute data-backdrop="false" to my modal? I am using the mdb plugin. Please I am new to vue js.


Jakub Strebeyko staff commented 3 years ago

Hi there @Mighty,

As I had a chance to explain elsewhere, what you are looking for is the removeBackdrop prop on the modal component. Please refer to official docs (API section) for all the the other possible built-in modal options.

We also do have a Vue dedicated part of the Support Board where you can find solutions to the most common issues.

With Best Regards,Kuba


Mirosław Stasiak free answered 5 years ago


Hi,

Just add this attribute to your modal data-backdrop="false"

When you want to add a background, add your own class with the appropriate color to the modal.

https://mdbootstrap.com/javascript/modals/#advancedUsage

Regards,


yatender rawat free commented 2 years ago

your solution didn't work bro


Grzegorz Bujański staff commented 2 years ago

Hi,

Working good for me. Look here: https://mdbootstrap.com/snippets/jquery/grzegorz-bujanski/1493819

Best, Grzegorz



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
Tags