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

Projects
None yet
2 participants
@lhyt
Copy link
Contributor

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

@pr-triage pr-triage bot added the PR: unreviewed label Jun 5, 2019

@tests-checker
Copy link

left a comment

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

@afc163

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

ci broken, please check it.

@codecov

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

@afc163 afc163 merged commit c8a9ca6 into ant-design:feature Jun 7, 2019

22 of 24 checks passed

packtracker/css Awaiting your base commit report...
Details
packtracker/javascript Awaiting your base commit report...
Details
LGTM analysis: JavaScript No new or fixed alerts
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
ant-design.ant-design #ant design succeeded
Details
buildsize No significant change
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_dist Your tests passed on CircleCI!
Details
ci/circleci: test_dist_15 Your tests passed on CircleCI!
Details
ci/circleci: test_dom Your tests passed on CircleCI!
Details
ci/circleci: test_dom_15 Your tests passed on CircleCI!
Details
ci/circleci: test_es Your tests passed on CircleCI!
Details
ci/circleci: test_es_15 Your tests passed on CircleCI!
Details
ci/circleci: test_lib Your tests passed on CircleCI!
Details
ci/circleci: test_lib_15 Your tests passed on CircleCI!
Details
ci/circleci: test_node Your tests passed on CircleCI!
Details
ci/circleci: test_node_15 Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 95.96%)
Details
codecov/project 96% (+0.04%) compared to e55a254
Details
security/snyk - package.json (paranoidjk) No manifest changes detected

@pr-triage pr-triage bot added PR: merged and removed PR: reviewed-approved labels Jun 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.