Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solely upgrade an element and all its children

Using componentHandler.upgradeAllRegistered(); upgrades all matching elements within the DOM, which is an unnecessary performance cost in my case:

When I insert an element in the DOM, anything from parent to root does not need to be re-upgraded. Only the element and its children are newly created elements and need re-initialization.

How can I achieve this functionality?

Some insides: https://github.com/google/material-design-lite/issues/871

like image 604
dylanmensaert Avatar asked Dec 13 '25 17:12

dylanmensaert


1 Answers

componentHandler.upgradeElements(node)

Where the node variable is the element (and children) you wish to upgrade.

like image 177
Garbee Avatar answered Dec 16 '25 22:12

Garbee