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): [tabs] Fix some events accidentally firing #14224

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

Mario34
Copy link
Contributor

@Mario34 Mario34 commented Sep 7, 2023

Fixes #14222

Description

🤖 Generated by Copilot at 5fdc290

Refactored setCurrentName function in tabs.tsx to simplify logic and fix event emission bug.

Related Issue

Fixes #14222

Explanation of Changes

🤖 Generated by Copilot at 5fdc290

  • Simplify and fix event emission logic for current name changes (link, link, link)
  • Remove changeCurrentName function and move its logic to setCurrentName (link)
  • Add trigger parameter to setCurrentName to control whether to emit events (link, link)
  • Use trigger parameter to allow beforeLeave hook to prevent events if it returns false (link)
  • Pass true as trigger parameter when user clicks on a tab in handleTabClick (link)

@pull-request-triage
Copy link

👋 @Mario34, 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.

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

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

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

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

@btea btea merged commit 35082b0 into element-plus:dev Sep 19, 2023
10 checks passed
@element-bot element-bot mentioned this pull request Oct 13, 2023
3 tasks
consultation-applio pushed a commit to consultation-applio/element-plus that referenced this pull request Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants