fix(button): fix line-height error when children contains other components

This commit is contained in:
unix
2020-03-23 01:02:14 +08:00
parent 6bf8e9774e
commit b7f767e816

View File

@@ -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>
)