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

Regression in 2.6.13 - buggy rendering of scoped slot content inside normalizeScopedSlot() #12105

Closed
tmcdos opened this issue Jun 2, 2021 · 4 comments

Comments

@tmcdos
Copy link

tmcdos commented Jun 2, 2021

Version

2.6.13

Reproduction link

https://codesandbox.io/s/quizzical-wildflower-mp7tm

Steps to reproduce

  1. create a component with scoped slot
  2. put at least 2 children inside this scoped slot
  3. make the first child conditionally rendered with V-IF directive

The V-IF directive in the first child will control the rendering of all the other siblings inside the scoped slot. This only happens if the first child inside the scoped slot uses V-IF - or if it is an HTML comment.

What is expected?

The V-IF should only affect the tag/component it is applied to - but not the siblings.

What is actually happening?

If the first child in any scoped slot is an HTML comment (and V-IF with a falsy argument actually renders HTML comment) - all the rest children in the scoped slot are not rendered.


The function "normalizeScopedSlot" in vue.runtime.esm.js for v2.6.13 is slightly different (and buggy) than v2.6.12.
In 2.6.12 the rendering is skipped if there is only 1 child in the scoped slot and this child is a comment.
However, in 2.6.13 there is no check for the number of children and the rendering of all children is skipped if the first child is both (a) comment and (b) not an async factory.

@tmcdos tmcdos changed the title Buggy rendering of scoped slot content inside normalizeScopedSlot() Regression in 2.6.13 - buggy rendering of scoped slot content inside normalizeScopedSlot() Jun 2, 2021
@posva
Copy link
Member

posva commented Jun 2, 2021

Already fixed!

@posva posva closed this as completed Jun 2, 2021
@tmcdos
Copy link
Author

tmcdos commented Jun 3, 2021

If you don't mind, would you tell me which commit fixes this regression? Because when I do npm install vue - the bug is still there, on line 67 in normalize-scoped-slot.js

@junhengDeng
Copy link

如果你不介意,你能告诉我哪个提交修复了这个回归?因为当我这样做时npm install vue- 错误仍然存​​在,在第 67 行normalize-scoped-slot.js

+1

@tmcdos
Copy link
Author

tmcdos commented Jun 11, 2021

Looks like this issue is a duplicate of #12102 - bug is fixed in development branch (by PR #12103) but not in the release.

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

No branches or pull requests

3 participants