Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Transform component's children to its default slot contents (fix #12232) #12417

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

Closed

Conversation

nestorrente
Copy link

@nestorrente nestorrente commented Jan 12, 2022

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

HTML tags written using some uppercase letters (i.e. <H1> or <Span>) will stop rendering their children. This happens because those tags are considered components by the maybeComponent() function, so after applying these changes their children will be considered the contents of its default slot. As native HTML tags doesn't have slots, they won't be rendered. This is explained in more detail in the attached video.

The recommendation in this case is to write the standard HTML tags always in lowercase (in fact, in Vue 3 a "failed to resolve component" warning is displayed when an uppercase tag is used, even when it's still rendered).

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Vue_12232_error_and_fix.mp4

P.S.: I just realized I didn't show the fixed version working as expected in the video (I forgot to modify the input during the demo). If you find it necessary, I can upload another video showing it 🙂 thank you very much!

@posva
Copy link
Member

posva commented Jan 13, 2022

Thank you but there is already #12265. Can you make sure that one also fixes your bug?

@posva posva closed this Jan 13, 2022
@nestorrente
Copy link
Author

Hi @posva!

Sorry, I didn't see #12265. Indeed, it solves this bug, and it does in a smarter way, without introducing any breaking changes 🙂

Thanks for your time!

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

Successfully merging this pull request may close these issues.

2 participants