LinusBorg / vue-simple-portal

A simpler Portal implementation focussed on moving slot content to the end of the body element
Other
223 stars 28 forks source link

Cannot read property 'removeChild' of null #66

Closed yogikatba closed 3 years ago

yogikatba commented 3 years ago

I am using portal inside a component of the sidebar. When I try to close the sidebar, it throws this error Cannot read property 'removeChild' of null. After checking source code from this error message I found this:

destroyed: function destroyed() {
    var el = this.$el;
    el && el.parentNode.removeChild(el);
 }

What's am I doing wrong?

yogikatba commented 3 years ago

I was using portal with a modal component. After wrapping the component with a div I'm not getting the error