diff --git a/apps/tests/ui/button/button-tests.ts b/apps/tests/ui/button/button-tests.ts index ac2a39811..127a9bb4f 100644 --- a/apps/tests/ui/button/button-tests.ts +++ b/apps/tests/ui/button/button-tests.ts @@ -320,7 +320,7 @@ export var test_WhenFormattedTextPropertyChanges_TextIsUpdated_Button = function view.formattedText = formattedString2; TKUnit.assertEqual(view.text, "SecondThird"); - formattedString2.spans[0].text = "Mecond"; + formattedString2.spans.getItem(0).text = "Mecond"; TKUnit.assertEqual(view.text, "MecondThird"); view.formattedText = null; diff --git a/apps/tests/ui/text-field/text-field-tests.ts b/apps/tests/ui/text-field/text-field-tests.ts index 4e7b25b4d..b2e780d18 100644 --- a/apps/tests/ui/text-field/text-field-tests.ts +++ b/apps/tests/ui/text-field/text-field-tests.ts @@ -497,7 +497,7 @@ export var test_WhenFormattedTextPropertyChanges_TextIsUpdated_TextBase = functi view.formattedText = formattedString2; TKUnit.assertEqual(view.text, "SecondThird"); - formattedString2.spans[0].text = "Mecond"; + formattedString2.spans.getItem(0).text = "Mecond"; TKUnit.assertEqual(view.text, "MecondThird"); view.formattedText = null; diff --git a/ui/button/button.android.ts b/ui/button/button.android.ts index a32a7edee..d80a2d163 100644 --- a/ui/button/button.android.ts +++ b/ui/button/button.android.ts @@ -45,8 +45,9 @@ export class Button extends common.Button { } public _setFormattedTextPropertyToNative(value) { + var newText = value ? value._formattedText : null; if (this.android) { - this.android.setText(value._formattedText); + this.android.setText(newText); } } } diff --git a/ui/button/button.ios.ts b/ui/button/button.ios.ts index 7fa02376e..d93ce2eff 100644 --- a/ui/button/button.ios.ts +++ b/ui/button/button.ios.ts @@ -64,7 +64,8 @@ export class Button extends common.Button { // the UIControlStateNormal value. If the value for UIControlStateNormal is not set, // then the property defaults to a system value. Therefore, at a minimum, you should // set the value for the normal state. - this.ios.setAttributedTitleForState(value._formattedText, UIControlState.UIControlStateNormal); + var newText = value ? value._formattedText : null; + this.ios.setAttributedTitleForState(newText, UIControlState.UIControlStateNormal); this.style._updateTextDecoration(); } } diff --git a/ui/text-base/text-base.android.ts b/ui/text-base/text-base.android.ts index 76593efec..e06054bc7 100644 --- a/ui/text-base/text-base.android.ts +++ b/ui/text-base/text-base.android.ts @@ -10,8 +10,9 @@ export class TextBase extends common.TextBase { } } public _setFormattedTextPropertyToNative(value) { + var newText = value ? value._formattedText : null; if (this.android) { - this.android.setText(value._formattedText); + this.android.setText(newText); } } } \ No newline at end of file diff --git a/ui/text-base/text-base.ios.ts b/ui/text-base/text-base.ios.ts index f0a845646..bf18342e6 100644 --- a/ui/text-base/text-base.ios.ts +++ b/ui/text-base/text-base.ios.ts @@ -11,7 +11,8 @@ export class TextBase extends common.TextBase { } public _setFormattedTextPropertyToNative(value) { - this.ios.attributedText = value._formattedText; + var newText = value ? value._formattedText : null; + this.ios.attributedText = newText; this.style._updateTextDecoration(); this.style._updateTextTransform(); this.requestLayout();