Topic: MDB 5 Modal not displaying
Kevin Raymond free asked 3 years ago
Expected behavior Modal is displayed. This works on all the documentation examples and in the test snippet I created.
Actual behavior No Modal is displayed. No errors in console.
Resources (screenshots, code snippets etc.) I created a test snippet based on the index.html that comes in the MDB Pro archive and the basic Modal example code. This works fine in the snippet but locally nothing. It's got to be something easy I'm overlooking, right?
Snippet: https://mdbootstrap.com/snippets/standard/kevin_raymond/2815092
Kevin Raymond free answered 3 years ago
This is completely from scratch using only code from the examples, and the mdb
infix is present. The exact code from the snippet doesn’t display the modal when I use it locally.
Maybe I have a different MDB version locally than I think (can’t check right now)?
Grzegorz Bujański staff commented 3 years ago
It is possible that you have a 2x version locally and you copy the code from 3.0.0. You can check this by simply removing the mdb
infix and seeing if it fixed the bug.
Kevin Raymond free commented 3 years ago
Sorry for the delayed response - this is what is was. I knew it was something silly. :facepalm:
Thanks!
bruhbred free answered 3 years ago
Hello Team i Have been trying to make a modal, i used the code in the documentation and i tried the fix for adding 'mdb' in my data-toggle and data-target
below is a copy of my code Launch modal
Are you sure?Grzegorz Bujański staff commented 3 years ago
Unfortunately, your code has not been added. Which version of MDB are you using? Please create a snippet with a code that doesn't work for you. I'll check it.
Grzegorz Bujański staff answered 3 years ago
I guess you did update from MDB v2 to MDB v3 and those modals stopped working?
Please see this link: https://mdbootstrap.com/docs/standard/getting-started/migration/#section-migrating-from-v2-to-v3.
There were some significant changes in v3. In this case, it will be about adding Infix mdb
.
Change data-toggle
and data-target
to data-mdb-toggle
and data-mdb-target
bruhbred free commented 3 years ago
Hello there, i have tried doing that, but it does not launch a Modal.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: 3.0.0
- Device: PC
- Browser: Edge/Chrome/Firefox
- OS: Win 10
- Provided sample code: No
- Provided link: Yes