-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
【2.0】DatePicker 自定义 children API 变更 #1036
Comments
先请试下 1.0.6 最新是不是已修复,谢谢 |
我这边没有 1.0.6 复现,请提供可复现的demo |
这是正常现象,仔细看 extra api 说明 以及示例 |
@warmhug 另外,类似的场景,感觉 rc-slider handle 这样子的api设计好一点,不依赖component嵌套,潜规则的props传递,而是显式的告诉用户 https://github.com/react-component/slider/blob/master/examples/handle.js#L34 |
我的想法是下个大版本改下API: const customHandle = ({value, onClick}) => {
return <List.Item arrow="horizontal" extra={value} onClick={onClick}>日期(CST)</List.Item>
}
const Demo = () => (
<DatePicker
mode="date"
title="选择日期"
extra="可选,小于结束日期"
minDate={minDate}
maxDate={maxDate}
handle={customHandle}
>
</DatePicker>
) @warmhug 这样如何? |
可以的,可以再讨论讨论、这个感觉不用着急。 另外记得,semver 版本号 1.x 版本要兼容升级,2.x 版本才能有 break change 的 |
@paranoidjk 再次评估下改动的成本收益、这几天确定结论 |
目前这种api 其实对 children 接收的 props 是有潜规则要求的,很容易就会有用户在自定义 children 这块出问题。 ref: #1801 ant-design/ant-design#5165 cc @silentcloud @afc163 @benjycui 发表下意见 |
先不改 api,完善文档。 |
能不能支持 datepicker 弹出时增加callback?以便处理某些触发事件 |
@shopshow support |
Environment(required) | 环境(必填)
1.0.3 / browser / google chrome 56.0.2924.87
What did you do? Please provide steps to re-produce your problem.(请提供复现步骤)
improt DatePicker
code:
What happen?(发生了何种非正常现象)
console output :
What do you expected?(预期的正常效果)
console no warning hint
The text was updated successfully, but these errors were encountered: