ant-design / ant-design

An enterprise-class UI design language and React UI library
https://ant.design
MIT License
93.39k stars 51.04k forks source link

type: seperate type of button onclick event with more detail #52654

Closed Brew-Brew closed 7 hours ago

Brew-Brew commented 5 days ago

中文版模板 / Chinese template

🤔 This is a ...

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

📝 Change Log

Language Changelog
🇺🇸 English Seperate type of button onclick event with more detail
🇨🇳 Chinese 具有更多详细信息的单独类型的按钮 onclick 事件
stackblitz[bot] commented 5 days ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

github-actions[bot] commented 5 days ago

Preview is ready

github-actions[bot] commented 5 days ago

👁 Visual Regression Report for PR #52654 Failed ❌

🎯 Target branch: master (51a213873c99cd1f47cc335d291e57310a0de558) 📖 View Full Report ↗︎ 📖 Alternative Report ↗︎ 📊 Summary: 🔄 1 changed

Expected (Branch master) Actual (Current PR) Diff
input-group.compact.png input-group.compact.png input-group.compact.css-var.png input-group.compact.css-var.png

[!IMPORTANT] There are 1 diffs found in this PR: 🔄 1 changed. Please check all items:

  • [x] Visual diff is acceptable
petercat-assistant[bot] commented 5 days ago

Walkthrough

This pull request improves the TypeScript definitions by separating the onClick event types for anchor buttons and regular buttons. This change ensures more precise type handling for button click events, enhancing type safety and clarity in the codebase.

Changes

File Summary
components/button/button.tsx Modified the onClick event handling to differentiate between anchor and regular buttons, using specific event types for each.
pkg-pr-new[bot] commented 5 days ago

Open in Stackblitz

More templates

- [farm-normal](https://pkg.pr.new/template/0cf5d8a3-f0f1-4ffe-a99f-afd72c5404e2) - [rsbuild-normal](https://pkg.pr.new/template/b7727665-47b0-4261-9a50-75fa7fadf17e) - [vite-normal](https://pkg.pr.new/template/13bc2151-98b7-4949-a032-73f42c9dc7b1) - [vite-practice](https://pkg.pr.new/template/730a355c-fd4e-421f-a060-6e166c25ddcf) - [with-nextjs-app-router-inline-style](https://pkg.pr.new/template/69b6ef87-165b-461b-99c8-3ee45af9bb31) - [umi-normal](https://pkg.pr.new/template/1e607750-87c7-47ef-a71f-00290d3735a9) - [with-nextjs-extract-style](https://pkg.pr.new/template/d6b7d8ac-80c3-417b-a651-4a0434ec1bda) - [with-nextjs-generate-css-on-demand](https://pkg.pr.new/template/3c2eb8cf-03c3-455e-8c6b-ee556940a2f4) - [with-nextjs-inline-style](https://pkg.pr.new/template/8939fb8d-0cc2-46b7-8c3f-8f6208d9ded5)

npm i https://pkg.pr.new/ant-design/ant-design/antd@52654

commit: 3e43e33

codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (04855cc) to head (3e43e33). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #52654 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 763 763 Lines 13780 13782 +2 Branches 3610 3612 +2 ========================================= + Hits 13780 13782 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

afc163 commented 2 days ago
图片 图片
afc163 commented 11 hours ago
图片
github-actions[bot] commented 7 hours ago

🎉 Thank you for your contribution! If you have not yet joined our DingTalk community group, please feel free to join us (when joining, please provide the link to this PR).

🎉 感谢您的贡献!如果您还没有加入钉钉社区群,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。