mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Merge pull request #3135 from NativeScript/issue-3064
Fix: Setting automationText to a number crashes the app on Android
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