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

Strange teleport behavior #1705

Closed
rik43 opened this issue Jul 24, 2020 · 1 comment
Closed

Strange teleport behavior #1705

rik43 opened this issue Jul 24, 2020 · 1 comment

Comments

@rik43
Copy link

rik43 commented Jul 24, 2020

Version

3.0

Reproduction link

https://codepen.io/rik43/pen/PoZLyqQ

Steps to reproduce

  <div id="app" class="demo">
    <div class="cell cell1"></div>  <!-- Works -->

    <div>
      <teleport to=".cell1">test 1</teleport>
      <teleport to=".cell2">test 2</teleport>
      <teleport to=".cell3">test 3</teleport>
    </div>
    
    <div class="cell cell2"></div>  <!-- NOT Works -->
  </div>
  
  <div class="cell cell3"></div>  <!-- Works -->

Why?

What is expected?

works in all cases

What is actually happening?

not work on test 2

@posva
Copy link
Member

posva commented Jul 25, 2020

Please check the console log:

[Vue warn]: Failed to locate Teleport target with selector ".cell2". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree. 
  at <App>

only the last portal target is valid in your reproduction

@posva posva closed this as completed Jul 25, 2020
@posva posva transferred this issue from vuejs/vue Jul 25, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants