Skip to content

Commit 0ca838e

Browse files
authored
fix(span): value handling for strings and numbers (#8651)
closes #8647
1 parent 29541b8 commit 0ca838e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • nativescript-core/ui/text-base

nativescript-core/ui/text-base/span.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ export class Span extends ViewBase implements SpanDefinition {
6565
}
6666
set text(value: string) {
6767
if (this._text !== value) {
68-
this._text = value && value.replace("\\n", "\n").replace("\\t", "\t");
69-
this.notifyPropertyChange("text", value);
68+
// value can be a number
69+
this._text = `${value}`.replace("\\n", "\n").replace("\\t", "\t");
70+
this.notifyPropertyChange("text", this._text);
7071
}
7172
}
7273

0 commit comments

Comments
 (0)