diff --git a/src/apis/destroy.js b/src/apis/destroy.js index 40b347d5..cc27f499 100644 --- a/src/apis/destroy.js +++ b/src/apis/destroy.js @@ -65,7 +65,9 @@ SmoothScrollbar.prototype.destroy = function (isRemoval) { // reset content const childNodes = [...content.childNodes]; - container.innerHTML = ''; + while (container.firstChild) { + container.removeChild(container.firstChild); + } childNodes.forEach((el) => container.appendChild(el)); });