portal-vue
portal-vue copied to clipboard
MountingPortal with append and transition is unable to safely unmount
Reproduction: https://jsfiddle.net/b2gezpw7/
If you pair MountingPortal with an append strategy and provide a transition it would fail to safely unmount when toggled by a wrapping v-if.
After unmount you'll get an error in console:
TypeError: Cannot read property 'removeChild' of null
Yeah, I don't see a way to fix this tough
Hey, I am having this exact same problem...
Working on a Modal component that uses a transition on a MountingPortal with append toggled by a v-if
Error from Portal-Vue on beforeDestroy:
vue.runtime.js?4b76:625 [Vue warn]: Error in beforeDestroy hook: "TypeError: Cannot read property 'removeChild' of null"
Here is my MountingPortal element code:
<MountingPortal
v-if="show"
mountTo="#modals"
name="source"
append
:transition="$options.components.Fade"
>
<div> ... </div>
</MountingPortal>