trvswgnr / bs5-lightbox

A pure JS lightbox gallery plugin for Bootstrap 5 based on the Modal and Carousel components
https://trvswgnr.github.io/bs5-lightbox/
MIT License
125 stars 28 forks source link

Bootstrap 5 hamburger menu opens but won't close #53

Closed garryknapper closed 1 year ago

garryknapper commented 1 year ago

Hi, I've installed the bs5-lightbox node module on a Wordpress site which is using Bootstrap 5. I've noticed that the following line of code is affecting the hamburger menu which is opening but not closing again. The 'show' class should disappear when the menu is closed but it remains on the element:

document.querySelectorAll('[data-toggle="lightbox"]').forEach(el => el.addEventListener('click', Lightbox.initialize));

Are you aware of any issues that this line of code might cause with the functionality of the hamburger menu?

trvswgnr commented 1 year ago

@garryknapper I haven't experienced that myself and I don't think there's anything affecting existing functionality. Can you provide some info for context like your Bootstrap version, OS, and browser? If possible, could you replicate the bug in a sandbox environment like CodePen? Thanks!

garryknapper commented 1 year ago

Hi @trvswgnr, thank you for you reply. The issue has now been resolved, it was due to the theme and I had to tweak the way that it was pulling in Bootstrap 5. The lightbox itself works perfectly now, thanks!