Skip to content

Commit

Permalink
fix(MdPortal): check fro only children elements before remove
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-hotmart committed Sep 21, 2017
1 parent 3fae6b0 commit d7e5845
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/MdPortal/MdPortal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@
this.$options._parentElm = this.targetEl
},
killGhostElement () {
if (this.targetEl.contains(this.$el)) {
this.targetEl.removeChild(this.$el)
if (this.targetEl) {
const children = Array.from(this.targetEl.childNodes)
if (children.includes(this.$el)) {
this.targetEl.removeChild(this.$el)
}
}
},
destroyElement () {
Expand Down

0 comments on commit d7e5845

Please sign in to comment.