Skip to content

fix(components): [tree] add optional chains to ensure el$ exists#23137

Merged
btea merged 3 commits into
element-plus:devfrom
liuzi6612:dev
Dec 18, 2025
Merged

fix(components): [tree] add optional chains to ensure el$ exists#23137
btea merged 3 commits into
element-plus:devfrom
liuzi6612:dev

Conversation

@liuzi6612
Copy link
Copy Markdown
Contributor

Hot updates may cause $el to not exist, requiring enhanced verification.

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 17, 2025

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Dec 17, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/element-plus/element-plus@23137
npm i https://pkg.pr.new/element-plus/element-plus@23137
yarn add https://pkg.pr.new/element-plus/[email protected]

commit: e06b780

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 17, 2025

🧪 Playground Preview: https://element-plus.run/?pr=23137
Please comment the example via this playground if needed.

@btea btea requested a review from Dsaquel December 17, 2025 07:08
@Dsaquel
Copy link
Copy Markdown
Member

Dsaquel commented Dec 17, 2025

I have tried many examples with tree-select and tree in vue blank vue project but can't reproduce the error.

Can you send a reproduction to confirm the issue please ?

@liuzi6612
Copy link
Copy Markdown
Contributor Author

liuzi6612 commented Dec 18, 2025

This error may occur in the development environment, not 100% of the time. It may occur when there are too many code modifications, which can lead to layout abnormalities. I suggest adding judgment.

@liuzi6612
Copy link
Copy Markdown
Contributor Author

liuzi6612 commented Dec 18, 2025

This is a reproduced video:Video

@Dsaquel
Copy link
Copy Markdown
Member

Dsaquel commented Dec 18, 2025

Ok we can apply the patch but can you confirm the bug is still here with the current dev version ? We migrate from vue 3.2 to 3.5.

See #21021 for the installation.

@liuzi6612
Copy link
Copy Markdown
Contributor Author

Yes, currently they are all the latest versions.

@Dsaquel
Copy link
Copy Markdown
Member

Dsaquel commented Dec 18, 2025

Next time try to make a reproduction to simplify the process. I can't judge if it's really related to us or not. More than that, i see there are other warnings/error, i'm not sure if this patch will be really helpful to you.

@Dsaquel Dsaquel requested a review from btea December 18, 2025 12:36
@btea btea changed the title fix(components): [tree] When a hot update occurs, the element does no… fix(components): [tree] add optional chains to ensure el$ exists Dec 18, 2025
@btea btea merged commit 8c4aaec into element-plus:dev Dec 18, 2025
17 of 18 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@xjh22222228 Thanks for your contribution! ❤️

@element-bot element-bot mentioned this pull request Dec 19, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants