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

SVG images not showing on Chromium based browsers (Edge and Chrome) #22

Open
relief-melone opened this issue Feb 12, 2021 · 1 comment

Comments

@relief-melone
Copy link

relief-melone commented Feb 12, 2021

It seems as if chromium based browsers can cause problems with the way flags are represented in the dom

currently

<img alt="gb" src="/path/to/flags/gb.svg" class="flag mx-3 gb-flag gb-flag--small" />

However if it is represented as an object it will work
working alternative

<object type="image/svg+xml" data="/path/to/flags/de.svg" class="flag gb-flag gb-flag--small"></object>

I don't know if this has something to do with in my case vue.js because it obviously works in chrome on your home page. But other than that I couldn't spot any difference in my code.

@relief-melone
Copy link
Author

relief-melone commented Feb 13, 2021

Alright. The issue was me serving the static content via a backend that didn't set the content-type header for svg files with

image/svg+xml

However it still be nice to add the flags as object instead of svg since the user won't have to worry about the content-type header in this case.

I could do a pull request to add this feature via prop (something like useObjectTag). Tell me if you're interested ;) should't be too much of work

@LeCoupa LeCoupa closed this as completed Feb 16, 2021
@LeCoupa LeCoupa reopened this Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants