Topic: Cannot fire show.mdb.popover event

soiware priority asked 1 year ago


My code is:

HTML

<button id="myPopover">
  Test
</button>

JS

const myPopoverTrigger = document.getElementById('myPopover')
const myPopover=new mdb.Popover(myPopoverTrigger,
{title:"Test",content:"Popover test with event"});
myPopoverTrigger.addEventListener('show.mdb.popover', () => {
    alert("Fired")
;});
myPopover.show();

Why the event is not fired?

(I clicked on "Create snipped" and create it: but how I can link this to my post? I clicked on "publish", is it fine? Anyway, I got many 404 error, failed to load resource as "https://mdbootstrap.com/api/snippets/static/download/MDB5-Pro-Advanced_6.1.0/js/mdb.min.js.map" etc...)


soiware priority answered 1 year ago


After may attempts I found this fix: change event id

show.mdb.popover

with

show.bs.popover

and it works.


Mateusz Lazaru staff commented 1 year ago

Thank you very much for sharing the solution, however show.mdb.popover should also work fine, but as I can see, it does not. I'll add it to our to-do list to fix it.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.1.0
  • Device: PC
  • Browser: All
  • OS: Windows and Mac
  • Provided sample code: No
  • Provided link: Yes