mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Fix: Setting automationText to a number crashes the app on Android
Resolves #3064
This commit is contained in:
@ -22,7 +22,7 @@ var VIEW_GROUP = "_viewGroup";
|
|||||||
|
|
||||||
function onAutomationTextPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
function onAutomationTextPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||||
var view = <View>data.object;
|
var view = <View>data.object;
|
||||||
view._nativeView.setContentDescription(data.newValue);
|
view._nativeView.setContentDescription(data.newValue + "");
|
||||||
}
|
}
|
||||||
(<proxy.PropertyMetadata>viewCommon.View.automationTextProperty.metadata).onSetNativeValue = onAutomationTextPropertyChanged;
|
(<proxy.PropertyMetadata>viewCommon.View.automationTextProperty.metadata).onSetNativeValue = onAutomationTextPropertyChanged;
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ global.moduleMerge(viewCommon, exports);
|
|||||||
|
|
||||||
function onAutomationTextPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
function onAutomationTextPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||||
var view = <View>data.object;
|
var view = <View>data.object;
|
||||||
view._nativeView.accessibilityIdentifier = data.newValue;
|
view._nativeView.accessibilityIdentifier = data.newValue + "";
|
||||||
view._nativeView.accessibilityLabel = data.newValue;
|
view._nativeView.accessibilityLabel = data.newValue + "";
|
||||||
}
|
}
|
||||||
(<proxy.PropertyMetadata>viewCommon.View.automationTextProperty.metadata).onSetNativeValue = onAutomationTextPropertyChanged;
|
(<proxy.PropertyMetadata>viewCommon.View.automationTextProperty.metadata).onSetNativeValue = onAutomationTextPropertyChanged;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user