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

Since vue 3.4.15 named slots not render with component same name like html tags #10395

Closed
nestle49 opened this issue Feb 24, 2024 · 1 comment

Comments

@nestle49
Copy link

Vue version

3.4.19

Link to minimal reproduction

https://github.com/nestle49/minimalReproduction

Steps to reproduce

  1. Clone repo
  2. npm i
  3. npm run dev
  4. Change TextArea.vue slot content, he's don't render. Change the name of the component, slot will be rendered

What is expected?

Names slots are visible or warn

What is actually happening?

Named slots don't render

System Info

System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M1
    Memory: 383.45 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.1 - ~/.nvm/versions/node/v20.5.1/bin/node
    npm: 9.8.0 - ~/.nvm/versions/node/v20.5.1/bin/npm
  Browsers:
    Chrome: 121.0.6167.184
    Safari: 17.3.1
  npmPackages:
    vue: 3.4.19 => 3.4.19

Any additional comments?

We used named slots and the name of the TextArea.vue component was the same as the textarea html tag. Before version 3.4.15 this worked, after updating to version 3.4.15 the named slots stopped rendering, and we did not receive any console warnings or any errors in the logs at all, as if everything was fine

I understand that this is not a very good practice, but the problem is that we learned about this after receiving broken sites. Could you print a warning to the console that components are using a reserved word? In this case, the html tag

Or at least about slots not being rendered, if possible

@nestle49 nestle49 changed the title Since vue 3.4.15 slots not render with component same name like html tags Since vue 3.4.15 named slots not render with component same name like html tags Feb 24, 2024
@edison1105
Copy link
Member

It was introduced in 3.4.0, handling TextArea as a textarea

// HTML mode
// - <script>, <style> RAWTEXT
// - <title>, <textarea> RCDATA
const lower = c | 0x20
if (lower === 116 /* t */) {
this.state = State.BeforeSpecialT
} else {
this.state =
lower === 115 /* s */ ? State.BeforeSpecialS : State.InTagName
}

OnlyWick pushed a commit to OnlyWick/core that referenced this issue Feb 27, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2024
lynxlangya pushed a commit to lynxlangya/core that referenced this issue May 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants