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

feat(ColorPicker): add destroyTooltipOnHide #42645

Merged
merged 4 commits into from Jun 19, 2023

Conversation

linxianxi
Copy link
Contributor

@linxianxi linxianxi commented May 26, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

页面中 ColorPicker 比较多时,打开后 dom 数量比较多

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English add destroyTooltipOnHide
🇨🇳 Chinese 添加 destroyTooltipOnHide

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 82bace3

Add a new prop destroyTooltipOnHide to the ColorPicker component, which controls whether the color state is preserved or reset when the popover is hidden. Update the English and Chinese documentation for the component accordingly.

🔍 Walkthrough

🤖 Generated by Copilot at 82bace3

  • Add destroyTooltipOnHide prop to ColorPicker component to control whether the popover should be destroyed when hidden or not (link, link, link, link, link)
  • Extend ColorPickerProps interface with destroyTooltipOnHide prop inherited from PopoverProps interface in components/color-picker/ColorPicker.tsx (link)
  • Pass destroyTooltipOnHide prop to useColorPicker hook and use it to reset color state when popover is hidden in components/color-picker/ColorPicker.tsx (link)
  • Pass destroyTooltipOnHide prop to Popover component and forward it to rc-trigger component in components/color-picker/ColorPicker.tsx (link)
  • Document destroyTooltipOnHide prop and its default value in English and Chinese documentation files in components/color-picker/index.en-US.md and components/color-picker/index.zh-CN.md (link, link)

@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2023

@linxianxi
Copy link
Contributor Author

看下是否需要改成名字,现在是直接拿的 popover 的属性名 destroyTooltipOnHide

@RedJue RedJue requested a review from MadCcc May 26, 2023 07:52
@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (4af6a52) 100.00% compared to head (b735e9c) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #42645   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          650       650           
  Lines        10956     10956           
  Branches      2971      2971           
=========================================
  Hits         10956     10956           
Impacted Files Coverage Δ
components/color-picker/ColorPicker.tsx 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@RedJue
Copy link
Member

RedJue commented May 26, 2023

不确定需不需要,内部讨论下。

@linxianxi linxianxi requested a review from MadCcc May 30, 2023 03:01
@MadCcc MadCcc merged commit 2c20dcd into ant-design:feature Jun 19, 2023
51 checks passed
@@ -48,6 +48,7 @@ group:
| disabled | 禁用颜色选择器 | boolean | - |
| placement | 弹出窗口的位置 | `top` \| `topLeft` \| `topRight` \| `bottom` \| `bottomLeft` \| `bottomRight` | `bottomLeft` |
| arrow | 配置弹出的箭头 | `boolean \| { pointAtCenter: boolean }` | `true` | - |
| destroyTooltipOnHide | 关闭后是否销毁弹窗 | `boolean` | `false` |
Copy link
Member

Choose a reason for hiding this comment

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

是不是没加版本号?

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

Successfully merging this pull request may close these issues.

None yet

4 participants