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

fix(components): [form] label rerendered when labelFor is true #16759

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Liao-js
Copy link
Contributor

@Liao-js Liao-js commented May 6, 2024

fix #16424

Please make sure these boxes are checked before submitting your PR, thank you!

  • 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.

Copy link

👋 @Liao-js, thank you for contributing element-plus.

  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

Copy link

github-actions bot commented May 6, 2024

Copy link

github-actions bot commented May 6, 2024

Hello @Liao-js, thank you for contributing to element-plus, please see our guideline to see how to make contribution

Copy link

github-actions bot commented May 6, 2024

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

Copy link
Collaborator

@btea btea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@makedopamine
Copy link
Contributor

makedopamine commented May 13, 2024

It makes SSR unfriendly.

before

after

@btea
Copy link
Collaborator

btea commented May 13, 2024

@makedopamine Thanks for the reminder, I overlooked this before. 👍

@Liao-js
Copy link
Contributor Author

Liao-js commented May 13, 2024

Any good suggestions?

@btea
Copy link
Collaborator

btea commented May 14, 2024

I haven't thought of any good method at the moment, @makedopamine do you have any suggestions?

@makedopamine
Copy link
Contributor

Since the value of labelFor depends on the value of inputIds, the key is to avoid getting stale value of labelFor in patch phase.

The PR #15183 addressed a similar issue to this, you can take a look.

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