typekit / webfontloader

Web Font Loader gives you added control when using linked fonts via @font-face.
Apache License 2.0
9.23k stars 649 forks source link

active-event not being triggered when two calls made back to back #309

Open onassar opened 8 years ago

onassar commented 8 years ago

The following JS Fiddle showcases the issue (running 1.6.21.min.js): https://jsfiddle.net/hp307g3w/1/

You'll see that while the second font's fontactive event is fired, the active is not.

bramstein commented 8 years ago

This looks like a bug. Is there any particular reason why you would call load like that?

onassar commented 8 years ago

I tried to simplify my application-logic, which itself will make multiple calls to load depending on how a user interacts with the app. Any timeline on a possible fix? Would be happy to test / confirm.

onassar commented 8 years ago

Any estimate on timeline?

grabks commented 8 years ago

@bramstein This appears to be impacting release 44 of Google Charts. I believe it's causing issue #2179 for us, where users are unable to draw multiple charts that use the WebFontLoader, since each chart makes its own load call.

Do you have any estimates for when this issue might be addressed?

bramstein commented 8 years ago

It looks like this was introduced when we made the modules load asynchronously. I think I know how to fix it, I'll try to find some time for it this week.

onassar commented 8 years ago

Great thanks @bramstein Looking forward to a fix

grabks commented 8 years ago

@bramstein Awesome! Thanks for the update!

onassar commented 8 years ago

Any movement here?

dlaliberte commented 8 years ago

The problem grabks reported above was not a problem in 1.6.8, but became a problem starting with 1.6.15. That might provide an additional clue to narrow this down.

codemanki commented 8 years ago

+1 here. Experiencing the same behaviour: making multiple calls to load and only first fires active event. All others just freeze

onassar commented 8 years ago

I'm using a bunk work-around for this. Good luck to you all :|

codemanki commented 8 years ago

@onassar could you please share your work-around? Because i only managed to get it work by downgrading to 1.6.7

onassar commented 8 years ago

Can't actually remember. Our code is a bit jumbled at the mo. Looking at it, it looks like I'm tracking fonts being loaded through an array. Should have abstracted it out as a patch, but I assumed owner of this repo would fix the issue.

scottanderson42 commented 7 years ago

This is still an issue in 1.6.27. We have a workaround that involves listening to fontloading, fontactive, and fontinactive, and tracking font loading by individual variants instead of the active/inactive events.

RavenXce commented 7 years ago

Seems to still be an issue in 1.6.28. Version 1.6.10 is the latest that works for me.

Goddak commented 6 years ago

Any update on this bug? It's quite old I'd have expected it to be fixed??

For anyone who still needs a fix

I've managed to get it working by downgrading to V1.6.7