Open codingwithchris opened 6 years ago
I am experiencing the same issue. Have you found a solution?
I figured it out. You need to initialize it when the elements are visible.
$('.modal').on('shown.bs.modal', function (e) {
// do your init here
});
@robsilva Yep! That's exactly what I ended up doing...sorry for not posting the solution here!
Demo Environment
url: http://staging.ilnetwork.flywheelsites.com/voices-project/ryan-hampton/ user: flywheel pass: creativefuse
Action
Click the purple share button near the top
Expected Behavior
A lightbox opens on the page. I am using Lightcase.js for this purpose.
When I click any of the share buttons inside the modal, I expect the share functionality to run as intended and open in a new window with content populated.
I am loading in the JS library for Social Share Kit via a JS bundle in the footer and initializing it in this way:
SocialShareKit.init({ selector: '.c-share__group .c-share__icon', });
Experienced Behavior
When I click any of the share buttons, the lightbox is closing and the current page is simply reloaded. No sharing functionality fires. Additionally, no console errors are logged.
Testing the Social Share Kit buttons outside of the lightbox properly trigger the share functionality.
I attempted implementing a wait after page load, and also tried to fire off SocialShareKit.init() after the lightbox content finishes loading. It appears that everything is properly initialized and running as it should, right up until a share button is clicked.