Topic: Modal not behaving as in examples or playground

KieranFoot priority asked 10 months ago


Expected behavior

Modal to display upon clicking the button in the NavBar. (Works in playground)

Actual behavior

Console error regarding backdrop being undefined.

Resources (screenshots, code snippets etc.)

Please see the snippet, which has been copy/pasted form my not working source. Playground

Perhaps I'm missing something, but again code that works in your playground required extra configuration to work for your clients.


KieranFoot priority answered 10 months ago


I got it working, but not as per my snippet.

I'm using custom IHtmlHelper extension methods to render MDBootstrap controls in my pages. It turns out it was a rendering order issue combined with the fact that I have an image inside the button.

I fixed the rendering order and added pointer-events: none; to the img tag and all of the errors are gone.

NOTE: The pointer events error is NOT thrown in your playground.


Kamila Pieńkowska staff answered 10 months ago


If you copied your code to the snippets and it works there then there is probably a problem with your configuration or interaction with another component that results in error.

How is your package imported?

Did you customize it?

Is 'ID' of the modal unique?



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: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.0
  • Device: PC
  • Browser: Edge
  • OS: Windows 11
  • Provided sample code: Yes
  • Provided link: Yes
Tags