Skip to content
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

feat(popconfirm): add disabled in popconfirm #16985

Merged
merged 3 commits into from Jun 7, 2019

Conversation

lhyt
Copy link
Contributor

@lhyt lhyt commented Jun 5, 2019

这个变动的性质是

  • 新特性提交
  • 其他改动(日常 bugfix、文档、站点改进、分支合并等,不需要填写余下的模板)

需求背景

  1. 需求的来源:包住有可能disabled的Button的时候,如果按钮是disabled,点击还会弹出确认框
  2. 这样子,就要加个判断,按照条件去掉外面那层Popconfirm;或者维护一个state控制visible属性,有点麻烦。
  3. issue

实现方案和 API

  1. 新增一个disabled的prop,当Popconfirm为disabled状态时,点击它所包住的按钮都不会弹出气泡确认框
  2. 在onVisibleChange方法中加上一个disabled为true的拦截

对用户的影响和可能的风险

  1. 这个改动对用户端无影响
  2. 预期的 changelog:
    zh-CN: Popconfirm组件新增disabled属性,控制点击 Popconfirm 子元素是否弹出气泡确认框
    en-US: add disabled prop in Popconfirm,to control the display when clicking its childrenNode
  3. 暂无其他风险

请求合并前的自查清单

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

后续计划

透传disabled给button。其实也不是很需要


View rendered components/popconfirm/index.en-US.md
View rendered components/popconfirm/index.zh-CN.md

Copy link

@tests-checker tests-checker bot left a comment

Could you please add tests to make sure this change works as expected?

@afc163
Copy link
Member

afc163 commented Jun 5, 2019

ci broken, please check it.

@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #16985 into feature will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           feature   #16985      +/-   ##
===========================================
+ Coverage    95.96%      96%   +0.04%     
===========================================
  Files          263      263              
  Lines         7329     7332       +3     
  Branches      2008     2047      +39     
===========================================
+ Hits          7033     7039       +6     
+ Misses         294      291       -3     
  Partials         2        2
Impacted Files Coverage Δ
components/popconfirm/index.tsx 100% <100%> (ø) ⬆️
components/_util/wave.tsx 88.67% <0%> (+2.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e55a254...c83d870. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #16985 into feature will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           feature   #16985      +/-   ##
===========================================
+ Coverage    95.96%      96%   +0.04%     
===========================================
  Files          263      263              
  Lines         7329     7332       +3     
  Branches      2008     2047      +39     
===========================================
+ Hits          7033     7039       +6     
+ Misses         294      291       -3     
  Partials         2        2
Impacted Files Coverage Δ
components/popconfirm/index.tsx 100% <100%> (ø) ⬆️
components/_util/wave.tsx 88.67% <0%> (+2.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e55a254...c83d870. Read the comment docs.

afc163
afc163 approved these changes Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants