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
I am using resize-observer-polyfill to watch for a window resizing (to update a graph drawn with d3). Under the hood it places a MutationObserver on the entire dom. If I have an md-icon in my application the application freezes.
What is the use-case or motivation for changing an existing behavior?
I would like to be able to use both resize-observer-polyfill and md-icon.
Which versions of Angular, Material, OS, browsers are affected?
I'd assume all.
Is there anything else we should know?
The root cause is that md-icon sets the aria-label attribute every single time ngAfterViewChecked is run. Setting this attribute is a DOM change and triggers the mutation observer. The mutation observer runs and then triggers a view check.
A simple patch to prevent modifying the DOM unless the aria label actually changed fixes the issue. I will submit a pull request soon.
The text was updated successfully, but these errors were encountered:
westonpace
added a commit
to westonpace/material2
that referenced
this issue
Jan 14, 2017
The md-icon component now caches the aria-label value and
only actually modifies the DOM if the value is unchanged.
This prevents md-icon from modifying the DOM every iteration
of change detection.
Closedangular#2642
Bug, feature request, or proposal:
I am using resize-observer-polyfill to watch for a window resizing (to update a graph drawn with d3). Under the hood it places a MutationObserver on the entire dom. If I have an md-icon in my application the application freezes.
What is the expected behavior?
The application should not freeze.
What is the current behavior?
The application freezes.
What are the steps to reproduce?
WARNING: If you are using chrome and hit run then this plunkr will eat 1 core and hang chrome.
http://plnkr.co/edit/1vgLbRbsV7D8RWvoBK8Y
What is the use-case or motivation for changing an existing behavior?
I would like to be able to use both resize-observer-polyfill and md-icon.
Which versions of Angular, Material, OS, browsers are affected?
I'd assume all.
Is there anything else we should know?
The root cause is that md-icon sets the aria-label attribute every single time ngAfterViewChecked is run. Setting this attribute is a DOM change and triggers the mutation observer. The mutation observer runs and then triggers a view check.
A simple patch to prevent modifying the DOM unless the aria label actually changed fixes the issue. I will submit a pull request soon.
The text was updated successfully, but these errors were encountered: