-
Notifications
You must be signed in to change notification settings - Fork 538
fix(color-picker): incorrect default value for recentColors
#5428
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
📝 更新日志tdesign-vue-next
|
TDesign Component Site Preview Open
|
commit: |
api 平台的改下 |
api 没问题… vue / react 那边也没问题,输出到 vue-next 这边就莫名是 |
tdesign-vue-next/packages/components/color-picker/components/panel/index.tsx Lines 59 to 64 in 3852924
tdesign-vue-next/packages/components/hooks/useDefaultValue.ts Lines 5 to 37 in 3852924
|
recentColors 支持受控和非受控 需要先用useDefaultValue 进行受控处理再传递给内部组件,确保正常支持受控和非受控 const [innerRecentColors, setInnerRecentColor] = useDefaultValue(
recentColors,
props.defaultRecentColors,
props.onRecentColorsChange,
'recentColors',
);
...
<ColorPanel
{...newProps}
recentColors={innerRecentColors.value}
onRecentColorsChange={setInnerRecentColor}
disabled={props.disabled}
value={innerValue.value}
togglePopup={setVisible}
onChange={(value: string, context: TdColorContext) => setInnerValue(value, context)}
/> |
777d704
to
2290fe4
Compare
🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
tdesign-vue-next
@tdesign-vue-next/chat
☑️ 请求合并前的自查清单