Commit 0d47d504 authored by jiulong.hjl's avatar jiulong.hjl Committed by 偏右

fix: fix tooltip position of Ellipsis

parent 96f92d49
...@@ -222,17 +222,20 @@ export default class Ellipsis extends Component { ...@@ -222,17 +222,20 @@ export default class Ellipsis extends Component {
// support document.body.style.webkitLineClamp // support document.body.style.webkitLineClamp
if (isSupportLineClamp) { if (isSupportLineClamp) {
const style = `#${id}{-webkit-line-clamp:${lines};-webkit-box-orient: vertical;}`; const style = `#${id}{-webkit-line-clamp:${lines};-webkit-box-orient: vertical;}`;
return (
const node = (
<div id={id} className={cls} {...restProps}> <div id={id} className={cls} {...restProps}>
<style>{style}</style> <style>{style}</style>
{tooltip ? (
<Tooltip overlayStyle={TooltipOverlayStyle} title={children}>
{children} {children}
</div>
);
return tooltip ? (
<Tooltip overlayStyle={TooltipOverlayStyle} title={children}>
{node}
</Tooltip> </Tooltip>
) : ( ) : (
children node
)}
</div>
); );
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment