From 9bf818a9ea78e2a1a7f3b74a3fed10990a25fb7e 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 8cae96a5..01083bda 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