Fix button text span wrap

pull/1411/head
afc163 9 years ago
parent b68c834949
commit 5f0b1ef006

@ -11,15 +11,16 @@ function isString(str) {
// Insert one space between two chinese characters automatically.
function insertSpace(child) {
if (isString(child) && isTwoCNChar(child)) {
return child.split('').join(' ');
}
if (isString(child.type) && isTwoCNChar(child.props.children)) {
return React.cloneElement(child, {},
child.props.children.split('').join(' '));
}
if (isString(child)) {
if (isTwoCNChar(child)) {
child = child.split('').join(' ');
}
return <span>{child}</span>;
}
return child;
}

Loading…
Cancel
Save