hc-offcanvas-nav icon indicating copy to clipboard operation
hc-offcanvas-nav copied to clipboard

BS5 events not firing

Open 5ulo opened this issue 3 years ago • 5 comments

When hc-offcanvas-nav is included, I can't use BS5 eg. shown.bs.tab event. Check the codepen for example. I added console.log on shown.bs.tab event and it does nothing. When I completely remove hc-offcanvas-nav plugin, everything works fine.

https://codepen.io/5ulo/pen/mdEVbWY

5ulo avatar Jul 12 '21 20:07 5ulo

So the same is for any other events.. like show.bs.dropdown . The removeOriginalNav: true option doesn't help in this case. Any idea how to make those events working with hc-offcanvas-nav loaded?

5ulo avatar Nov 30 '21 00:11 5ulo

Hello, the issue here is also impacting the Sauce (SNPT) plugin, even when simply including the hc-offcanvas-nav JS, without performing any instantiation. Specifically the issue kicks in for us when the hc-offcanvas-nav.helpers.js is included as a script tag.

It's hijacking the clicks for our plugin, seeming due to it overriding the Node.prototype.addEventListener in its addRemoveListener. I'm not familiar enough with HC offcanvas yet, but it seems like it can be conflict with many other plugins by modifying any use of e.g document.addEventListener.

mrjamesriley avatar Jan 11 '22 17:01 mrjamesriley

Same here on integrating into Magento 2. I agree with @mrjamesriley . The "EventListener" logic probably creates many problems.

sfritzsche avatar Mar 17 '22 13:03 sfritzsche

I'll have to re-write this or figure something else for capturing event listeners.

somewebmedia avatar Mar 25 '22 17:03 somewebmedia

Hi, the issue also breaks bootstrap 5 modal events. hc-offcanvas is a very nice offcanvas menu and i would like to use it further. i have migrated my template to bootstrp 5. unfortunately it also partially destroys the bootstrap 5 events for me. does anyone have a workaround on how to get this running.

coweb01 avatar Jul 29 '22 10:07 coweb01