Skip to content
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

<base> breaks icons #29

Closed
davidspiess opened this issue Mar 29, 2016 · 8 comments
Closed

<base> breaks icons #29

davidspiess opened this issue Mar 29, 2016 · 8 comments
Labels

Comments

@davidspiess
Copy link

If a base element is present, the icons break, regardless if i'm using angular or not. Why not make a universal solution?

@kisenka
Copy link
Contributor

kisenka commented Mar 29, 2016

@davidspiess #25 (comment)

@princed
Copy link
Contributor

princed commented Mar 29, 2016

Unfortunately we can't have automatic universal solution.
Angular is just widespread case of <base> usage, which is easy to automate.

@davidspiess
Copy link
Author

Why not always use an absolute path like in the solution mentioned by @kisenka? Shouldn't that fix the <base> problem completely?
At the moment i'm using something like this

<use xlink:href="${ window.location.href.split('#')[0] + icon }"></use>

@princed
Copy link
Contributor

princed commented Mar 30, 2016

Because absolute path changes when navigation (using history API) happened, so we have to update xlink:hrefs of all existing icons, that's why we listen to custom spriteLoaderLocationUpdated event in order to do it on time.

So actually you need both second and third point from the comment.

@davidspiess
Copy link
Author

Thanks for the clarification :) I didn't think about the history api. More docs about the <base> issue would be a great addition 👍

@princed
Copy link
Contributor

princed commented Mar 30, 2016

My pleasure :)
Let us know if you have any ideas on custom event API.

@princed
Copy link
Contributor

princed commented Mar 30, 2016

@davidspiess BTW, would you like to make a PR regarding #30?

@davidspiess
Copy link
Author

@princed right now i'm quite busy, but i'll dive into it this weekend :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants