Cannot fire show.mdb.popover event


Topic: Cannot fire show.mdb.popover event

soiware pro premium priority asked 2 years 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 pro premium priority answered 2 years ago

After may attempts I found this fix: change event id

show.mdb.popover

with

show.bs.popover

and it works.


mlazaru staff commented 2 years 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

Open

Specification of the issue
  • User: Pro
  • 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