Strange Behavior on Modals

Topic: Strange Behavior on Modals

evieira357 pro asked 3 years ago


I'm creating one component to work with my generic dilog (see the code below that i'm using to show it), how you can see i'm disable the background click 'cause onley through the buttons the user can close/confirm this one.

To test it, i put one button in my page and after click the modal apper perfectly and the background click is disabled, but if i press the key "enter" the button show the dialog again (eventhoug the background is disabled).

There is some smart way to handle this situation?

Thanks Edson.

The code behind the button.

this.modalRef =, { backdrop: false, keyboard: true, focus: true, show: false, ignoreBackdropClick: true, class: 'modal-dialog-centered modal-dialog', animated: true, });

Damian Gemza staff answered 3 years ago

Dear @evieira357

As for now, there's a problem with disable opening dynamic modal after it is visible.

We have to resolve this problem. Unfortunately, I can't provide you any fix for this problem.

You could try to disable the Modal toggle button after the modal is visible, and remove disable when you're closing it.

Best Regards,


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
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.4
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No