diff --git a/lib/components/Redoc/redoc.js b/lib/components/Redoc/redoc.js index a0ccd4d5..53e16317 100644 --- a/lib/components/Redoc/redoc.js +++ b/lib/components/Redoc/redoc.js @@ -117,6 +117,7 @@ export default class Redoc extends BaseComponent { static dispose() { let dom = new BrowserDomAdapter(); let el = dom.query('redoc'); + let elClone; let parent; let nextSibling; if (el) { @@ -124,14 +125,15 @@ export default class Redoc extends BaseComponent { nextSibling = el.nextElementSibling; } + elClone = el.cloneNode(false); + if (Redoc.appRef) { Redoc.appRef.dispose(); Redoc.appRef = null; // Redoc dispose removes host element, so need to restore it - el = dom.createElement('redoc'); - el.innerText = 'Loading...'; - parent && parent.insertBefore(el, nextSibling); + elClone.innerHTML = 'Loading...'; + parent && parent.insertBefore(elClone, nextSibling); } } }