From a10ff9ad61f932f599595093e36e28291cd2f6b7 Mon Sep 17 00:00:00 2001 From: Andre Wachsmuth Date: Tue, 8 Oct 2024 19:05:59 +0100 Subject: [PATCH] Fix error when DOM element is already detached during call to destroy method --- src/tagify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tagify.js b/src/tagify.js index ba31dcec..7bfc0ecd 100644 --- a/src/tagify.js +++ b/src/tagify.js @@ -300,7 +300,7 @@ Tagify.prototype = { */ destroy(){ this.events.unbindGlobal.call(this) - this.DOM.scope.parentNode.removeChild(this.DOM.scope) + this.DOM.scope.parentNode && this.DOM.scope.parentNode.removeChild(this.DOM.scope) this.DOM.originalInput.tabIndex = this.DOM.originalInput_tabIndex delete this.DOM.originalInput.__tagify this.dropdown.hide(true)