-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
prefer: optimize allow clear logic #42439
prefer: optimize allow clear logic #42439
Conversation
changelog 可以写详细一些 |
ok |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #42439 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 640 640
Lines 10819 10823 +4
Branches 2936 2937 +1
=========================================
+ Hits 10819 10823 +4
☔ View full report in Codecov by Sentry. |
覆盖率掉了 |
看到了,在修复 |
好像还是 0%: Kapture.2023-05-18.at.14.34.54.mp4 |
需要操作一下才行,随便拖动一下色板 |
感觉这样有点奇怪,不拖动色板可以实现吗? |
没操作那肯定还是清空的状态,你只是打开面板而已,不应该去动清空的状态,这个符合常识,不然我每次打开清空就没了,感觉像个bug |
OK,那让 @MadCcc 闲夕大佬看一下吧,没问题就合了 |
这个不如直接在这个 PR 做掉吧 |
可以,我在 rc 加个属性好了 |
@@ -9,7 +10,7 @@ import ColorPresets from './components/ColorPresets'; | |||
import type { ColorPickerBaseProps } from './interface'; | |||
|
|||
interface ColorPickerPanelProps extends ColorPickerBaseProps { | |||
onChange?: (value?: Color) => void; | |||
onChange?: (value?: Color, type?: HsbaColorType) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type 先不要透出去
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
allowClear
interaction logic, reopening the panel to select a color will default to 100% transparency instead of 0%.allowClear
交互逻辑,重新打开面板选择颜色会默认 100% 透明度,而不是 0%。☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at aefdeda
This pull request improves the
color-picker
component by adding more tests and fixing a bug with the alpha slider. The tests cover the basic interactions with the component, and the bug fix ensures that the alpha slider resets correctly after clearing the color.🔍 Walkthrough
🤖 Generated by Copilot at aefdeda
components/color-picker/ColorPicker.tsx