mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
fix(span): value handling for strings and numbers (#8651)
closes https://github.com/NativeScript/NativeScript/issues/8647
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user