Closed
Description
What is the expected behavior?
The MatIconRegistry
returns the correct icon using MatIconRegistry._extractSvgIconFromSet
.
What is the current behavior?
MatIconRegistry._extractSvgIconFromSet
cannot find the icon due to an incorrect query selector.
What are the steps to reproduce?
Register a SVG icon set containing a SVG with id "icon-300 my icon"
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular Material 5.1.0 and higher
Is there anything else we should know?
Currently the MatIconRegistry
makes use of iconSet.querySelector('#' + iconName)
:
https://github.com/angular/material2/blob/master/src/lib/icon/icon-registry.ts#L452
Instead it should be using iconSet.getElementById(iconName)
Then in my case it returns the correct SVG element.