-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
Reproduction
https://stackblitz.com/edit/angular-gbzhv4
Steps to reproduce:
- Create an SVG sprite with
symbolelement withviewBox - Register the icon set with MatIconRegistry
- Use the icon with
mat-iconandsvgIcon
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)
Metadata
Metadata
Assignees
Labels
No labels