Skip to content

Commit

Permalink
fix: Fixed the problem that icon size and size settings are not consi…
Browse files Browse the repository at this point in the history
…stent, affecting version 2.59.0-2.60.1 (#2308)
  • Loading branch information
YyumeiZhang authored Jun 19, 2024
1 parent 0a6d387 commit 02976ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/semi-ui/typography/_story/typography.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -907,3 +907,15 @@ export const InheritSize = () => {
</Text>
)
}

export const SizeAffectIcon = () => {
// 增加用例,观察 size 设置对 icon 大小的影响
return (
<>
<Text size="normal" icon={<IconLink />} underline>带下划线的网页链接</Text>
<br />
<br />
<Text size="small" icon={<IconLink />} underline>带下划线的网页链接</Text>
</>
)
}
2 changes: 1 addition & 1 deletion packages/semi-ui/typography/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
const iconSize: Size = realSize === 'small' ? 'small' : 'default';
return (
<span className={`${prefixCls}-icon`} x-semi-prop="icon">
{isSemiIcon(icon) ? React.cloneElement((icon as React.ReactElement), { realSize: iconSize }) : icon}
{isSemiIcon(icon) ? React.cloneElement((icon as React.ReactElement), { size: iconSize }) : icon}
</span>
);
}
Expand Down

0 comments on commit 02976ad

Please sign in to comment.