From 582523ccc9f1713b382fd229bd9e8086c2cd84eb Mon Sep 17 00:00:00 2001 From: niko <644506165@qq.com> Date: Mon, 9 Jul 2018 17:58:13 +0800 Subject: [PATCH] Add overflow-wrap & wordWrap for ? character break line. Fix: #1767 (#1808) --- src/components/Ellipsis/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/Ellipsis/index.js b/src/components/Ellipsis/index.js index 5adb50cd..6b5a5d76 100644 --- a/src/components/Ellipsis/index.js +++ b/src/components/Ellipsis/index.js @@ -8,6 +8,11 @@ import styles from './index.less'; const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined; +const TooltipOverlayStyle = { + overflowWrap: 'break-word', + wordWrap: 'break-word', +}; + export const getStrFullLength = (str = '') => { return str.split('').reduce((pre, cur) => { const charCode = cur.charCodeAt(0); @@ -54,7 +59,7 @@ const EllipsisText = ({ text, length, tooltip, fullWidthRecognition, ...other }) if (tooltip) { return ( - + {displayText} {tail} @@ -223,7 +228,7 @@ export default class Ellipsis extends Component {
{tooltip ? ( - + {children} ) : ( @@ -244,7 +249,7 @@ export default class Ellipsis extends Component {
{tooltip ? ( - + {childNode} ) : ( -- GitLab