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

Duplicate Twitter buttons #107

Open
diniscorreia opened this issue Aug 12, 2015 · 15 comments
Open

Duplicate Twitter buttons #107

diniscorreia opened this issue Aug 12, 2015 · 15 comments

Comments

@diniscorreia
Copy link

Twitter buttons are now being duplicated (actually, it looks like it creates and additional button for any other tweet button on the page).

Even the project's home page is showing the problem (two tweet buttons appear under Demo).

Probably some change on Twitter's end?

@osvaldasvalutis
Copy link

And in some cases the buttons are tripled.

@joneslloyd
Copy link

The same story with me

@alexcasalboni
Copy link

Same problem here.

Everything works fine if I remove this line inside twitterInit, which seems to create a second anchor element.
In fact, the whole twitterInit function appears to be useless now. Maybe it's just a deprecated workaround?

Update: that's not it. But it unexpectedly worked fine for a couple of times.

Update2: it worked only because I used my browser debugger and stopped the script execution. Even without changing any code, this "fixes" the problem, therefore I'd assume it's some kind of race condition during the Twitter script loading. Maybe it's loaded/bound twice?

Update3: if I comment everything inside twitterActivate, it works fine. Maybe twitter is now calling window.twttr.widgets.load(); automatically by default?

@joneslloyd
Copy link

Hmm, that doesn't seem to be working for me.

@alexcasalboni
Copy link

@joneslloyd sorry, I updated my comment.

I'm fixing it on my side by removing/commenting twitterActivate, for now. My hypothesis is that Twitter is now binding the widgets automatically, and therefore calling window.twttr.widgets.load(); is not required anymore.

I'll be waiting for a more official fix.

@joneslloyd
Copy link

@alexcasalboni Thanks! Is that along with the whole twitterInit function removed?

I'll try this and see if it solves it :)

@alexcasalboni
Copy link

@joneslloyd no, twitterInit is still required otherwise the widget won't show up at all.

@joneslloyd
Copy link

I see, thank you.

That's actually not working for me. Now I'm getting the other social networks loading, and the unstyled ahref text of the Twitter share button (without it loading into the twitter share button).

@diniscorreia
Copy link
Author

Yep, I ended up removing window.twttr.widgets.load(); to fix it.
I suspect the same, it's probably being loaded automatically. Not sure if the Twitter docs changed, but right now it only mentions twttr.widgets.load() when new content is appended to the DOM.

@tmort
Copy link
Owner

tmort commented Aug 13, 2015

@diniscorreia Can you provide a live link to the issue on your site? Unfortunately not seeing the issue, even on the homepage.

Here is what I am seeing:
2015-08-13_0710

@alexcasalboni
Copy link

@tmort maybe you have a cached version of the Twitter JS in your browser. I can see two Twitter buttons on the homepage as well.

socialite-bug

@tmort
Copy link
Owner

tmort commented Aug 13, 2015

@alexcasalboni Got it. Will check out when I'm in the office later today. @diniscorreia I'll give your fix a try first - if that is the solution I'll have an update ASAP.

Thanks to all of you for creating the thread and catching this.

@alexcasalboni
Copy link

@tmort any update on this? Do you think our current hotfix might create problems?
I mean, if Twitter decides to rollback this update, no widgets will show up at all. Can you think of any better workaround to handle both cases?

@diniscorreia
Copy link
Author

@alexcasalboni not the best solution, but if you need a quick workaround that doesn't mess with the plugin, you can just use CSS to hide all the iframes inside that element except for the first child.

@Kedarnath-Rothe
Copy link

Please assign this issue to me

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

6 participants