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: ColorPicker presets cannot be selected #42882

Merged
merged 5 commits into from
Jun 7, 2023

Conversation

RedJue
Copy link
Member

@RedJue RedJue commented Jun 7, 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

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix ColorPicker preset cannot be selected
🇨🇳 Chinese 修复颜色选择器预设没法选中的问题

☑️ 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 f5f4df7

Removed useMemo hook from items variable in components/color-picker/components/ColorPresets.tsx to fix a bug with color preset panels. This was part of a pull request to enhance the color picker component.

🔍 Walkthrough

🤖 Generated by Copilot at f5f4df7

  • Removed useMemo hook from items variable to fix panel update bug (link)

@RedJue RedJue requested review from kiner-tang and MadCcc June 7, 2023 03:28
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Prepare preview

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Pull reviewers stats

Stats of the last 30 days for ant-design:

User Total reviews Time to review Total comments
afc163 100 1h 36m 90
li-jia-nan 92 2h 19m 83
MadCcc 56 2d 11h 5m 135
kiner-tang 51 20m 28
yoyo837 33 42m 36
zombieJ 29 2h 55m 26
RedJue 10 3h 50m 15
heiyu4585 2 30m 0
RexSkz 2 48m 5
BoyYangzai 2 17m 6
vagusX 1 1h 36m 0
Wxh16144 1 21m 3
any1024 1 7h 10m 2
sawadyecma 1 1h 51m 2
bombillazo 1 23h 49m 2
lke-twh 1 2h 49m 0

@RedJue RedJue changed the title fix: ColorPicker preset cannot be selected fix: ColorPicker presets cannot be selected Jun 7, 2023
})),
[],
);
const items: CollapseProps['items'] = presetsValue.map((preset) => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

不memo了循环次数会不会比较多

Copy link
Member Author

Choose a reason for hiding this comment

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

逻辑里有需要实时判断 value 的,所以加不加区别不大,value 变了就要重新循环。

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 375.73 KB (-2 B 🔽)
./dist/antd-with-locales.min.js 435.07 KB (-3 B 🔽)

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (a87427b) 100.00% compared to head (ce9aad1) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #42882   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          715       715           
  Lines        64206     64199    -7     
  Branches      4753      4752    -1     
=========================================
- Hits         64206     64199    -7     
Impacted Files Coverage Δ
...omponents/color-picker/components/ColorPresets.tsx 100.00% <100.00%> (ø)

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

@MadCcc
Copy link
Member

MadCcc commented Jun 7, 2023

测试用例补一下吧

@RedJue RedJue force-pushed the fix-color-picker-presets-not-checked branch from ac6c90a to df882d5 Compare June 7, 2023 06:41
@MadCcc MadCcc merged commit 2437043 into master Jun 7, 2023
@MadCcc MadCcc deleted the fix-color-picker-presets-not-checked branch June 7, 2023 09:29
@MadCcc MadCcc mentioned this pull request Jun 7, 2023
20 tasks
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.

3 participants