fix: prefixCls dosen't pass to Popconfirm's Button #12677
Conversation
ref: #10855 |
It seems that there are props which can assign prefixCls to Modal's Button. ant-design/components/modal/Modal.tsx Lines 43 to 44 in 86c11e5 |
Got it. |
Sure, I'm going to commit again. |
Codecov Report
@@ Coverage Diff @@
## master #12677 +/- ##
=======================================
Coverage 92.34% 92.34%
=======================================
Files 211 211
Lines 5550 5550
Branches 1561 1600 +39
=======================================
Hits 5125 5125
+ Misses 421 419 -2
- Partials 4 6 +2
Continue to review full report at Codecov.
|
title="x" | ||
prefixCls="custom-popconfirm" | ||
okButtonProps={{ prefixCls: btnPrefixCls }} | ||
cancelButtonProps={{ prefixCls: btnPrefixCls }} |
yesmeck
Oct 17, 2018
•
Member
A little....too verbose, can we introduce a context provider for prefixCls
?
A little....too verbose, can we introduce a context provider for prefixCls
?
zombieJ
Oct 17, 2018
Member
I think keep it is OK. Though if user want prefix root with 'abc' but inner component with 'def'.
I think keep it is OK. Though if user want prefix root with 'abc' but inner component with 'def'.
concefly
Oct 18, 2018
Author
Contributor
Most off all, we only need a single prefixCls in a project. So I think that context provider is much better.
exp:
<PrefixClsProvider prefixCls='custom'>
<Button />
</PrefixClsProvider>
Then the Button will have default prefixCls with 'custom'
Most off all, we only need a single prefixCls in a project. So I think that context provider is much better.
exp:
<PrefixClsProvider prefixCls='custom'>
<Button />
</PrefixClsProvider>
Then the Button will have default prefixCls with 'custom'
zombieJ
Oct 18, 2018
Member
OK. I guess we can close this PR and open a new one.
OK. I guess we can close this PR and open a new one.
concefly
Oct 18, 2018
Author
Contributor
Well... this PR is a bug fix so maybe we could merge it and then make a new feature PR for PrefixClsProvider ?
Well... this PR is a bug fix so maybe we could merge it and then make a new feature PR for PrefixClsProvider ?
yesmeck
Oct 18, 2018
Member
这个先合并吧,不过这个是新增了属性,算 feature 了,要 PR 到 feature 分支。
这个先合并吧,不过这个是新增了属性,算 feature 了,要 PR 到 feature 分支。
Should we marge this PR? |
@@ -106,10 +108,10 @@ class Popconfirm extends React.Component<PopconfirmProps, PopconfirmState> { | |||
<div className={`${prefixCls}-message-title`}>{title}</div> | |||
</div> | |||
<div className={`${prefixCls}-buttons`}> | |||
<Button onClick={this.onCancel} size="small"> | |||
<Button onClick={this.onCancel} size="small" {...(cancelButtonProps || {})}> |
yesmeck
Oct 19, 2018
Member
直接 {...cancelButtonProps}
就可以了。
直接 {...cancelButtonProps}
就可以了。
concefly
Oct 19, 2018
Author
Contributor
改了
改了
057c8a3
into
ant-design:master
First of all, thank you for your contribution! :-)
Please makes sure that these checkboxes are checked before submitting your PR, thank you!
master
, feature for branchfeature
.npm run lint
and fix those errors before submitting in order to keep consistent code style.Extra checklist:
if isBugFix :
elif isNewFeature :
#12676
Add
btnPrefixCls
for Popconfirm's Button