Topic: Modal button throws error - Uncaught TypeError: this._element is undefined

sportssouth priority asked 3 years ago


Expected behavior No errors when clicking on a button that triggers a modal.

Actual behavior Get consistent console errors when clicking on an icon or any element inside of a button or anchor element that either throw "Uncaught TypeError: this._element is undefined" or "Uncaught TypeError: e is null". See snippet for basic example of this happening, you have to click on the actual icon inside the button for it to trigger. It does not throw and error if you click the button not occupied by the icon.

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/standard/sportssouth/3184746


Michał Duszak staff answered 3 years ago


Hello,

this happens due to the interactions with <i> element. To solve this problem, add pe-none class to the icon element, so your element looks like:

<i class="fas fa-plus pe-none"></i>

See this snippet for live demo: https://mdbootstrap.com/snippets/standard/m-duszak/3188410



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 3.8.1
  • Device: Any
  • Browser: Any
  • OS: Any
  • Provided sample code: No
  • Provided link: Yes