-
Notifications
You must be signed in to change notification settings - Fork 538
refactor(color-picker): ensure mode switches based on color value #5319
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
Conversation
23aded6
to
ebfd45f
Compare
TDesign Component Site Preview Open
|
commit: |
65013dc
to
3af2df6
Compare
3af2df6
to
b5382f0
Compare
b5382f0
to
c3351fb
Compare
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.
Pull Request Overview
This PR refactors the color-picker panel component to ensure that the mode switches automatically based on the current color value. It updates the logic to use a new getModeByColor function for determining the color mode, adjusts color state updates accordingly, and refines the event triggers in the setColor handlers.
Comments suppressed due to low confidence (1)
packages/components/color-picker/components/panel/index.tsx:249
- [nitpick] Consider renaming the 'value' parameter in handleSetColor to 'colorValue' for improved clarity about its purpose.
const handleSetColor = (value: string, trigger: ColorPickerChangeTrigger) => {
37ecc5c
to
69294da
Compare
Note 需要等 common 仓库 PR 合并,并同步对应的公共方法 |
/update-common |
413e184
to
8903b5f
Compare
📝 更新日志tdesign-vue-next
|
🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
Tip
以下出现的双栏截图和视频,左边均是有问题的版本,右边是预期合理的版本
1. PC 端统一修复➕重构
② 新增最近使用颜色仍为渐变色,未更新为单色
Tencent/tdesign-vue#3566
② ♻️ 最近使用颜色、预设颜色 【视频 1-2-2】
② ♻️ 优化格式化返回值,例如 RGB 转为 RGBA,HSL 转为 HSLA 等
② 移除 onBlur 事件,避免与 onChange 重复触发
③ onChange 回调传入
context: { color: ColorObject; trigger: 'input' }
,符合文档标注的 TS 类型,避免返回给用户一个 undefined 或合成事件2. Vue Next 特有 Bug 修复
📝 更新日志
tdesign-vue-next
HEX8
,移除HSB
;使用渐变模式的业务请注意此变更☑️ 请求合并前的自查清单