-
Notifications
You must be signed in to change notification settings - Fork 1
css on transition/statechange only? #2
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
Comments
+1 I have a similar issue. |
That's odd, but I do think you're right because when I use my demo directly, I see only 1 stylesheet loaded while on the other hand, I see 3 when I go to the demo state from a different state. Therefore this is a bug. Thanks for reporting it. |
Actually, the demo was working fine as it loaded all three stylesheet but it just didn't display them in the view. It only does this after a transition, but that's not the same problem you guys are having. Can either of you supply a small demo in https://plnkr.co/ or https://jsfiddle.net/? |
Here is a small demo which reproduces the bug: Plunker. As you will see, the expected behavior is that when the user clicks on "State #1", a blue text appears, and if it clicks on "State #2", a red one appears. But the first "state" you select won't have any CSS applied to it template. Indeed, the text stays black. The style is applied only when the user clicks on the other state and from this moment, all styles are well taken into account. |
I see... I'll look into the issue, thanks for taking the time to make the plunker 👍 |
It seems it's a bit worse than I suspected. My script is doing everything as expected, but the browser isn't really handling the disabled state of the stylesheet very well. Removing the code that disables/enables the stylesheet, and everything seems to work just fine. But that defeats the purpose of the plugin quite a bit... So I'll have to dive into this issue a bit more. |
I think I got it: https://plnkr.co/edit/NaqHA4Ti9OZ883XVmLOC?p=preview (I updated the plugin's source file that includes the fix I just did). I'll be making a patch shortly. |
I've made the patch (0.1.1). So hopefully this fixes your problem, let me know your findings! |
Hi, first thanks for this great script.
So, at first I ended up on an error and my console.log logs that I need to install bestol load stylesheet before I can use your script.
After I installed, css are now loaded in each specific state. But there is one thing I observed. When I am on the homepage css for that state doesn't load as windows load, it only happens on transition/state change??
Help
The text was updated successfully, but these errors were encountered: