You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an SVG sprite with symbol element with viewBox
Register the icon set with MatIconRegistry
Use the icon with mat-icon and svgIcon
For me the stackblitz link is not working, but if you download the project, then you can check the issue with npm install & ng serve.
Expected Behavior
SVG correctly rendered.
Actual Behavior
The SVG element is correctly placed inside the DOM, but the icon is not visible.
Probable root cause
If the viewbox is large enough, only the top left 24x24 pixels are shown on the screen. This is because the viewBox attribute is not copied from the symbol element. Manually adding it to the svg element in DevTools fixes the error.
Environment
Angular: 8.2.4
CDK/Material: 8.1.4
Browser(s): Chrome Version 76.0.3809.132
Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 (Version 1809 Build 17763.678)
The text was updated successfully, but these errors were encountered:
Reproduction
https://stackblitz.com/edit/angular-gbzhv4
Steps to reproduce:
symbol
element withviewBox
mat-icon
andsvgIcon
For me the stackblitz link is not working, but if you download the project, then you can check the issue with
npm install & ng serve
.Expected Behavior
SVG correctly rendered.
Actual Behavior
The SVG element is correctly placed inside the DOM, but the icon is not visible.
Probable root cause
If the viewbox is large enough, only the top left 24x24 pixels are shown on the screen. This is because the
viewBox
attribute is not copied from the symbol element. Manually adding it to thesvg
element in DevTools fixes the error.Environment
The text was updated successfully, but these errors were encountered: