Skip to content

Commit

Permalink
Fix error when DOM element is already detached during call to destroy…
Browse files Browse the repository at this point in the history
… method
  • Loading branch information
awa-xima authored and yairEO committed Oct 25, 2024
1 parent a5ff0d2 commit a10ff9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tagify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a10ff9a

Please sign in to comment.