Topic: Modal Trigger - Change from Text to IMG (Running into Error)

Marvin Herbold priority asked 1 year ago


MDB Snippet

MDB modals throw an error when something else besides text is used as a trigger. For this example I'm using an image, but ideally I want to use an animated SVG. Even if I change the "button" to an "a" link, the issue is still there..

*Expected behavior*Not throwing an error?

*Actual behavior*Throws Uncaught TypeError: Cannot read properties of undefined (reading 'classList') error whenever picture trigger is clicked...

Resources (screenshots, code snippets etc.)enter image description here

Any help is appreciated. Thanks!


Kamila Pieńkowska staff answered 1 year ago


You need to add class pe-none to the image.

Example snippet here: https://mdbootstrap.com/snippets/standard/kpienkowska/4431800



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 4.2.0
  • Device: Desktop PC
  • Browser: Chrome
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: Yes