Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share Buttons Not Working Within Modal #70

Open
codingwithchris opened this issue Feb 9, 2018 · 3 comments
Open

Share Buttons Not Working Within Modal #70

codingwithchris opened this issue Feb 9, 2018 · 3 comments

Comments

@codingwithchris
Copy link

codingwithchris commented Feb 9, 2018

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

  1. A lightbox opens on the page. I am using Lightcase.js for this purpose.

  2. 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.

  3. 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

  1. 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.

  2. Testing the Social Share Kit buttons outside of the lightbox properly trigger the share functionality.

  3. 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.

@robsilva
Copy link

robsilva commented May 9, 2018

I am experiencing the same issue. Have you found a solution?

@robsilva
Copy link

robsilva commented May 9, 2018

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
});

@codingwithchris
Copy link
Author

@robsilva Yep! That's exactly what I ended up doing...sorry for not posting the solution here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants