-
-
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
emit('history:stateChange') not working with client-side routing in Safari #40
Comments
Hey! Thank you very much! Sorry that you've been having problems with it. That's actually a really silly mistake on my behalf -- as noted in #18, Safari requires SVG gradient URLs to include the full page path when certain client-side routing libraries are used. My solution was to prepend Here's the part where location.href is used, I think it might be more correct to use some combination of @recklessruby91 I'll make a new branch to work on this fix later this evening. Would you be okay to test it before I push it into the main branch? Of course, if you want to submit a Pull Request that's totally welcome too :) |
Thanks for the speedy response! That makes sense! I was seeing the url hash being passed to the SVG gradient URL when I was stepping through. I'm more than happy to test it before you push it to the main branch. Let me know when it's ready! |
In the end I went with |
Works like a charm! I've tested with Safari on Mac and also on Safari iOS. Thank you sooo much for sorting this!! |
No problem! Thanks for flagging the problem and helping to test the fix! I'll go ahead and push it into the main branch now. :> |
Tiny update on this: with the latest version of the library (version 4.0.0), |
Hello!
Firstly thanks for writing such a neat colour picker library!
My application uses client-side routing and I've encountered the dreaded black wheel when using Safari browsers. This only occurs when the URL has additional hash parameters, for example, 'www.mydomain.com/' displays fine. Whilst 'www.mydomain.com/#somehash' produces a functional but black wheel the same as in the closed issue 18.
I create a new instance of the colour picker after the hash navigation and then use call emit('history:stateChange') to update the SVG gradient URLs. The hash navigation doesn't change whilst the colour picker is in use. Code below.
`var colourPicker = new iro.ColorPicker('#colour-picker', {
width: 300,
height: 300,
color: "#f00",
});
colourPicker.emit('history:stateChange');`
I've stepped through the .emit function and I can see the SVG URLs being updated but the dreaded black wheel doesn't update. Can you help me pinpoint whats going on?
The text was updated successfully, but these errors were encountered: