fix(span): value handling for strings and numbers (#8651)

closes https://github.com/NativeScript/NativeScript/issues/8647
This commit is contained in:
Nathan Walker
2020-06-17 11:07:38 -07:00
committed by GitHub
parent 29541b89b1
commit 0ca838ed0c

View File

@ -65,8 +65,9 @@ export class Span extends ViewBase implements SpanDefinition {
}
set text(value: string) {
if (this._text !== value) {
this._text = value && value.replace("\\n", "\n").replace("\\t", "\t");
this.notifyPropertyChange("text", value);
// value can be a number
this._text = `${value}`.replace("\\n", "\n").replace("\\t", "\t");
this.notifyPropertyChange("text", this._text);
}
}