-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Black output on Safari #18
Comments
Hi, sorry to hear that you've been having problems with iro.js I've just tested the library using Safari 11 (on both macOS and iOS) and can't seem to replicate the issue myself, so to get to the bottom of this I need to ask a couple of things:
Thanks! Hopefully we can figure out what's going on soon :) |
Hi, a little more info:
This is the init code:
|
Hm, that's pretty strange. There doesn't seem to be anything unusual about the options you're passing into If that doesn't solve anything then I'd really appreciate it if you could reproduce the issue in a codepen / jsbin / etc :> |
Yes I've tried that as well.. But without result. Could it have anything to do with the fact that it is placed inside an absolute positioned modal element? The difference between Safari and other browsers is interesting in this case... |
Ah! I think the problem is that Angular might actually be "breaking" the SVG gradient URLs. This Stack Overflow answer explains the issue in depth (even though it's about filters, they work in a similar way to gradients). TL;DR Angular adds a base tag to the head of your HTML document. The base tag changes the location of relative URLs on the page, so the color picker's UI elements can't find the gradients they're supposed to be using. Who knows why that's a Safari-only issue, but it seems to be the most likely culprit here. Perhaps you could confirm? I'll look around for possible solutions and hopefully get it fixed by tomorrow. :> |
Small update: I've managed to reproduce the issue within Safari, and indeed, it appears that using a I've been working on a fix over in the bug/broken-gradient-url branch. If you want to try it out, the compiled scripts are in the With that said, I noticed a second Safari-only issue. If you're using iro.js as part of a web application that implements client-side routing with the HTML history API, then the SVG gradients will also break when the user navigates to another view. I'm not quite sure how to solve that one to be honest, but I'll see what I can do. |
Ah good to see that you're on to something here :) I'll test it right away... |
Works like a charm! Even after navigating. Thanks a lot! :) |
Great! I'm glad that fixed it :> I pushed a couple of extra changes since my last comment:
I'll push them into master tomorrow unless you come across any other related bugs \ o / By the way, since you're using the iro.js in a large application, please don't hesitate to also submit feature requests/suggestions if you think there's anything that would be helpful! |
Using commit 07efb22 now (latest as of this moment) and still working fine. I do not need to use |
Changes merged into master, so I'm going to close this thread now. |
Hi,
The color picker library works great on all browsers, except Safari. Actually it is also fully functional. I can interact with it, feed it color hex and receive color updates from the library.
Except the color wheel and lightness bar are all black. What could be wrong?
The text was updated successfully, but these errors were encountered: