mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix: setting text in Span to number/null/undefined
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import formattedStringCommon = require("./formatted-string-common");
|
||||
import spanModule = require("text/span");
|
||||
import types = require("utils/types");
|
||||
|
||||
global.moduleMerge(formattedStringCommon, exports);
|
||||
|
||||
@@ -12,7 +13,7 @@ export class FormattedString extends formattedStringCommon.FormattedString {
|
||||
var spanText = "";
|
||||
for (i = 0; i < this.spans.length; i++) {
|
||||
var span = <spanModule.Span>this.spans.getItem(i);
|
||||
spanText = span.text || "";
|
||||
spanText = types.toUIString(span.text);
|
||||
spanLength = spanText.length;
|
||||
if (spanLength !== 0) {
|
||||
ssb.insert(spanStart, spanText);
|
||||
|
||||
Reference in New Issue
Block a user