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: components used in confirm title and content support prefixCls #27376

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

Chersquwn
Copy link
Contributor

@Chersquwn Chersquwn commented Oct 26, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

Background:

Modal.config 中 设置的 rootPrefixCls, 只会作用于Modal.confirm 中的 Modal组件部分,而不会作用于Modal接收的antd子组件,如titlecontent。因为titlecontent的类型是ReactNode,可以接收antd组件,在全局设置prefixCls后,会导致这部分组件样式丢失,目前解决方式只能在每个使用的地方都加上prefixCls

Solution:

Modal.confirm 内部形成一个 context,复用ConfigProvider,将Modal.config 中 设置的 rootPrefixCls传给内部ConfigProvider

📝 Changelog

Language Changelog
🇺🇸 English rootPrefixCls set in Modal.config can be effective for the antd components used in title and content
🇨🇳 Chinese Modal.config 中设置的 rootPrefixCls 可以对titlecontent下使用的antd组件生效

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Oct 26, 2020

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 43ac514:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #27376 into feature will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           feature    #27376   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          389       389           
  Lines         7393      7393           
  Branches      2080      2031   -49     
=========================================
  Hits          7393      7393           
Impacted Files Coverage Δ
components/modal/ConfirmDialog.tsx 100.00% <100.00%> (ø)

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 23f8cce...43ac514. Read the comment docs.

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.

3 participants