Skip to content

Inline SVG element not adjusting to available width #15975

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

Closed
ikondrasovas opened this issue May 26, 2018 · 2 comments
Closed

Inline SVG element not adjusting to available width #15975

ikondrasovas opened this issue May 26, 2018 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@ikondrasovas
Copy link

The following inline SVG element is properly rendered into a regular bootstrap page:

<svg viewBox="0 0 3000 1500" preserveAspectRatio="xMidYMin slice" style="width: 100%; padding-bottom:calc(50%); height: 1px; overflow: visible"> <rect width="3000" height="1500" /> <line x1="0" y1="0" x2="3000" y2="1500" style="stroke:rgb(255,0,0);stroke-width:2" /> </svg>

However, when used into my Blazor project, the svg width is not properly adjusted to the available width.

There are some necessary workarounds to make this width adjustment works in most browsers and they usually work, but not with my Blazor project.

Is this something known that is related to Blazor? What should I do?

Thank you,

@SteveSandersonMS
Copy link
Member

I don’t think this is related to Blazor, since Blazor doesn’t control your CSS styling at all.

But if you end up tracking this down and find that there is some issue in Blazor please do let us know!

@mdegroot71
Copy link

I am having the same issues. I've taken all of the same CSS, Javascript and produced HTML from Blazor, popped it into a static HTML page and ran it. The SVG scales as it should without any workarounds. I'm using Chrome. When I run it with Blazor, the SVG behaves in a weird way. This isn't a CSS issue. This is definitely a rendering issue b/c no matter how I inject the SVG, it still does not behave as if Blazor was not present.

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/blazor Oct 27, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Oct 27, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

4 participants