-
Notifications
You must be signed in to change notification settings - Fork 10.3k
SVG attributes namespaces are not applied inside components #6169
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
Thanks for contacting us, @CobraCalle. |
We think you're running into an encoding issue. We should try using MarkupString in this case. |
I tracked this down. The issue is not to do with encoding. It's purely to do with how the JS-side code applies the attribute. For normal DOM elements, you can always use element.setAttributeNS('http://www.w3.org/1999/xlink', 'href', attributeValueString); To implement this,
As a further alternative, we may note that the entire xlink namespace has been deprecated since SVG 2 and should no longer be used anyway. Browsers are free to drop support for it, and some may already have done. Developers should just use Does anyone know of scenarios in SVG where it's still necessary to use Moving to "backlog" so we can reconsider when/if we have more information. |
Closing as we will be tackling this as part of #18271 |
I want to inline an image in a svg and provide the image as data url. When the data url is generated through blazor the image will not be loaded
Steps to reproduce the behavior:
Expected behavior
As you can see: In this sample the dat url is provided through blazor (xlink:href="@("data:image/png;base64,")")... the image will not be shown… change is to xlink:href="data:image/png;base64,")... and it will work
The text was updated successfully, but these errors were encountered: