question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.6.13] Node after v-if node inside named slot is not shown anymore

See original GitHub issue

Version

2.6.13

Reproduction link

https://codesandbox.io/s/recursing-dream-0zdf5?file=/src/App.vue

Steps to reproduce

<template>
  <ComponentWithSlot>
    <template #slot-name>
      <span v-if="false">...</span>
      <span>This is shown in 2.6.12, but not in 2.6.13.</span>
    </template>
  </ComponentWithSlot>
</template>

What is expected?

The text after the v-if node should be shown.

What is actually happening?

It was shown in 2.6.12, but isn’t shown in 2.6.13 anymore.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:5

github_iconTop GitHub Comments

9reactions
gilles-crealpcommented, Jun 2, 2021

Another workaround is to put an empty node first.

<template>
  <ComponentWithSlot>
    <template #slot-name>
      <div /> <!-- HERE -->
      <span v-if="false">...</span>
      <span>This is shown in 2.6.12, but not in 2.6.13.</span>
    </template>
  </ComponentWithSlot>
</template>
0reactions
caugnercommented, Jun 2, 2021

The issue seems to be with the normalizeScopedSlot function

Good catch, this would suggest the regression is caused by #11963.

/cc @pi0

edit: My guess would be that this is the solution:

     return res && (
       !vnode ||
-      (vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
+      (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
     ) ? undefined
      : res
Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Only show slot if it has content - Stack Overflow
UPDATE I wrote a plugin for this so the need for importing the custom-slot component in each consumer component is not needed anymore...
Read more >
Claas Augner (@ClaasAug) / Twitter
Newest version of Mozilla's Privacy Not Included guide is now available, ... [2.6.13] Node after v-if node inside named slot is not shown...
Read more >
2.6.13-mm3 - Google Groups
I/O acticity. - The size of the page allocator per-cpu magazines has been increased. - The page allocator has been changed to use...
Read more >
Bug listing with status RESOLVED with resolution UPSTREAM ...
status:RESOLVED resolution:UPSTREAM severity:major · Bug:40457 - "After enabling the OpenGL specturm analyser any atempt to disable it crashes xmms-1.2.9" ...
Read more >
Untitled
Fyne ales brewery tour, Thai luk thung music video, Film onlain 2015, ... Vreme za gluposti download, Xpath node count, Lifescapes emerald isle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found