Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MountingPortal with append and transition is unable to safely unmount #298

Open
CyberAP opened this issue May 4, 2020 · 2 comments
Open

Comments

@CyberAP
Copy link

CyberAP commented May 4, 2020

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

@LinusBorg
Copy link
Owner

Yeah, I don't see a way to fix this tough

@borovez
Copy link

borovez commented Sep 12, 2020

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants