This commit is contained in:
Horcrux
2017-01-16 21:01:12 +08:00
parent 5625f56d19
commit 43e45b95c5
3 changed files with 39 additions and 5 deletions

View File

@@ -96,11 +96,13 @@ export default function(props, container) {
let { children } = props;
let content = null;
if (typeof children === 'string') {
if (typeof children === 'string' || typeof children === 'number') {
const childrenString = children.toString();
if (container) {
children = <TSpan>{children}</TSpan>;
children = <TSpan>{childrenString}</TSpan>;
} else {
content = children;
content = childrenString;
children = null;
}
} else if (Children.count(children) > 1) {
@@ -121,7 +123,7 @@ export default function(props, container) {
deltaX,
deltaY,
startOffset: (startOffset || 0).toString(),
positionX: _.isNil(x) ? null : x,
positionY: _.isNil(y) ? null : y
positionX: _.isNil(x) ? null : x.toString(),
positionY: _.isNil(y) ? null : y.toString()
}
}