IE is not painting elements

2019-09-04 19:55发布

问题:

I have an angular app that is using SVG to draw a horizontal bar chart and a vertical bar chart.

However, the horizontal bar chart is not being painted. The horizontal SVG rects are in the DOM and will paint correctly if I simply toggle off and back on a CSS property. But they will not paint initially.

回答1:

In my application I was using Angular Material. Angular Material has the following CSS selector:

md-menu-content[width="3"] {
min-width: 168px; }

I removed the above CSS and my Horizontal Bar chart paints.

My guess is that IE does not work well with non-native DOM element selectors and that because I was animating on the same width attribute(in my horizontal bar chart) that this selector was querying it broke IE's paint algorithm.