From b42fc7fdae297528291501c74ea29df3d0af93f8 Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Mon, 21 Nov 2016 15:03:35 +0200 Subject: [PATCH] Fix: Setting automationText to a number crashes the app on Android Resolves #3064 --- tns-core-modules/ui/core/view.android.ts | 2 +- tns-core-modules/ui/core/view.ios.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tns-core-modules/ui/core/view.android.ts b/tns-core-modules/ui/core/view.android.ts index b7732c04c..1b1cbaa09 100644 --- a/tns-core-modules/ui/core/view.android.ts +++ b/tns-core-modules/ui/core/view.android.ts @@ -22,7 +22,7 @@ var VIEW_GROUP = "_viewGroup"; function onAutomationTextPropertyChanged(data: dependencyObservable.PropertyChangeData) { var view = data.object; - view._nativeView.setContentDescription(data.newValue); + view._nativeView.setContentDescription(data.newValue + ""); } (viewCommon.View.automationTextProperty.metadata).onSetNativeValue = onAutomationTextPropertyChanged; diff --git a/tns-core-modules/ui/core/view.ios.ts b/tns-core-modules/ui/core/view.ios.ts index 06be5a1dc..f4addaf6e 100644 --- a/tns-core-modules/ui/core/view.ios.ts +++ b/tns-core-modules/ui/core/view.ios.ts @@ -13,8 +13,8 @@ global.moduleMerge(viewCommon, exports); function onAutomationTextPropertyChanged(data: dependencyObservable.PropertyChangeData) { var view = data.object; - view._nativeView.accessibilityIdentifier = data.newValue; - view._nativeView.accessibilityLabel = data.newValue; + view._nativeView.accessibilityIdentifier = data.newValue + ""; + view._nativeView.accessibilityLabel = data.newValue + ""; } (viewCommon.View.automationTextProperty.metadata).onSetNativeValue = onAutomationTextPropertyChanged;