Topic: Strange Behavior on Modals

evieira357 pro asked 5 years ago


Hi,

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 = this.modal.show(DialogComponent, { backdrop: false, keyboard: true, focus: true, show: false, ignoreBackdropClick: true, class: 'modal-dialog-centered modal-dialog', animated: true, });


Damian Gemza staff answered 5 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,

Damian



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