PolymerElements / iron-iconset-svg

Represents a source of icons expressed as a collection of inline SVGs
https://www.webcomponents.org/element/PolymerElements/iron-iconset-svg
37 stars 34 forks source link

If icons are created too early, they are not mirrored in RTL correctly. #64

Closed helenxywu closed 6 years ago

helenxywu commented 7 years ago

Description

When RTL is on and the icon is mirrored, if an icon is instantiated to early, then all icons are not mirrored. When computedStyle of direction is checked, the direction is still "" (which becomes rtl later, but not at the time of created).

Expected outcome

Icons are always mirrored when specified in RTL.

Actual outcome

Icons are sometimes not mirrored even if a top level element has dir="RTL".

Georgegriff commented 7 years ago

I think I may have seen this issue, or similar. I have an iron-iconset-svg which is used via an iron-icon inside of an element. If i lazy load that element (Polymer.Base.importHref) and enable network throttling, i find that icons do not appear. I've followed this through and it appears that my iron-iconset-svg set is not registered in iron-meta at the point the icon is attempted to be used, so the icon does not appear. I've reduced the size of my iconset down and this problem goes away.

I suppose the workaround is splitting up icon set to be smaller and not lazy loading iconsets. Just an interesting gotcha i suppose