The DijitWrapper should not preserve DOM when destroying a Dijit instance. This is because when a DijitWrapper is destroyed by the widgeting system, it is only done when the DOM it is responsible is supposed to be removed from the document. Preserving the DOM causes phantom Dijit instances to render when there is some sort of conditional rendering in the direct parent.
Bug
The
DijitWrapper
should not preserve DOM when destroying a Dijit instance. This is because when aDijitWrapper
is destroyed by the widgeting system, it is only done when the DOM it is responsible is supposed to be removed from the document. Preserving the DOM causes phantom Dijit instances to render when there is some sort of conditional rendering in the direct parent.