Merge pull request #2678 from m-abs/issue-2621

Fixes #2621: Add accessibility labels to views
This commit is contained in:
dtopuzov
2016-09-07 11:51:01 +03:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -79,4 +79,5 @@ export function test_automation_text_set_to_native() {
var newButton = new button.Button();
newButton.automationText = "Button1";
TKUnit.assertEqual((<UIView>newButton.ios).accessibilityIdentifier, "Button1", "accessibilityIdentifier not set to native view.");
}
TKUnit.assertEqual((<UIView>newButton.ios).accessibilityLabel, "Button1", "accessibilityIdentifier not set to native view.");
}

View File

@@ -21,6 +21,7 @@ global.moduleMerge(viewCommon, exports);
function onAutomationTextPropertyChanged(data: dependencyObservable.PropertyChangeData) {
var view = <View>data.object;
view._nativeView.accessibilityIdentifier = data.newValue;
view._nativeView.accessibilityLabel = data.newValue;
}
(<proxy.PropertyMetadata>viewCommon.View.automationTextProperty.metadata).onSetNativeValue = onAutomationTextPropertyChanged;