I've come across an interaction between the Angular2 router and the Material Design Lite (MDL) animations. If I create an <input>
element in a component that is rendered by the <router-outlet>
component in Angular2, MDL doesn't properly handle my interactions with it (doesn't show focus animation, doesn't clear placeholder text, etc). If, on the other hand, the <input>
appears outside the <router-outlet>
, there is no problem.
It seems like it has something to do with the dynamic nature of the contents of <router-outlet>
. I thought this would solve the issue. I added an ngAfterViewInit
and ngAfterViewChecked
handler to my application (and even to my custom directive that extends RouterOutlet
). No luck. I can see the componentHandler
variable and call the updateDom
method...no problem. But it has no effect.
There must be some way to get MDL to "see" these dynamically created elements, but my attempts with upgradeDom
haven't been working. Maybe upgradeDom
isn't the problem...but then what is.
Any suggestions?