mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-24 04:15:54 +08:00
fix(button): fix line-height error when children contains other components
This commit is contained in:
@@ -80,7 +80,7 @@ const Button: React.FC<React.PropsWithChildren<ButtonProps>> = React.memo(({
|
||||
|
||||
return (
|
||||
<button ref={buttonRef} className={`btn ${className}`} disabled={disabled} onClick={clickHandler} {...props}>
|
||||
{loading ? <ButtonLoading /> : <span className="text">{children}</span>}
|
||||
{loading ? <ButtonLoading /> : <div className="text">{children}</div>}
|
||||
{dripShow && <ButtonDrip
|
||||
x={dripX} y={dripY}
|
||||
color={theme.palette.accents_2}
|
||||
@@ -135,6 +135,10 @@ const Button: React.FC<React.PropsWithChildren<ButtonProps>> = React.memo(({
|
||||
line-height: inherit;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.text :global(p), .text :global(pre), .text :global(div) {
|
||||
margin: 0;
|
||||
}
|
||||
`}</style>
|
||||
</button>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user