Socialite
Socialite copied to clipboard
Duplicate Twitter buttons
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?
And in some cases the buttons are tripled.
The same story with me
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?
Hmm, that doesn't seem to be working for me.
@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.
@alexcasalboni Thanks! Is that along with the whole twitterInit function removed?
I'll try this and see if it solves it :)
@joneslloyd no, twitterInit is still required otherwise the widget won't show up at all.
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).
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.
@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:
@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.

@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.
@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?
@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.
Please assign this issue to me