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

Fix/button icon loading not working #555

Merged
merged 4 commits into from
Jan 19, 2023

Conversation

RedJue
Copy link
Member

@RedJue RedJue commented Jan 19, 2023

[中文版模板 / 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
  • Workflow
  • Other (about what?)

🔗 Related issue link

fix #40282

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Button icon rotation animation not working when using iconPrefixCls
🇨🇳 Chinese 修复在用 iconPrefixCls 时,按钮加载图标动画丢失问题

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • 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

const { csp } = useContext(IconContext);
const { csp, prefixCls = 'anticon' } = useContext(IconContext);

if (typeof prefixCls === "string") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (prefixCls) 就够了,不用做类型判断~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

@@ -142,7 +142,11 @@ export const iconStyles = `
`;

export const useInsertStyles = (styleStr: string = iconStyles) => {
const { csp } = useContext(IconContext);
const { csp, prefixCls = 'anticon' } = useContext(IconContext);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这边不用设置默认值,否则下面 if 总是会走进去

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里之前写的时候删掉了,后来改着改着又加回去了.. 我修正一下

@zombieJ zombieJ merged commit 268ee52 into ant-design:master Jan 19, 2023
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.

Button with loading property not working when custom iconPrefixCls on ConfigProvider
2 participants