From cd48ee3dbfcffc4c0e66aa80a592aa73c033b61d Mon Sep 17 00:00:00 2001 From: paweldomas Date: Tue, 28 Nov 2017 11:50:34 -0600 Subject: [PATCH] feat: add more accessibility labels Adds more accessibility labels required for mobile automated testing. --- react/features/base/react/components/native/Container.js | 8 +++++++- react/features/conference/components/Conference.native.js | 2 ++ react/features/toolbox/components/ToolbarButton.native.js | 2 ++ react/features/toolbox/components/Toolbox.native.js | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/react/features/base/react/components/native/Container.js b/react/features/base/react/components/native/Container.js index 0383d87ff9..0b5c2bfd92 100644 --- a/react/features/base/react/components/native/Container.js +++ b/react/features/base/react/components/native/Container.js @@ -30,6 +30,8 @@ export default class Container extends AbstractContainer { */ render() { const { + accessibilityLabel, + accessible, onClick, touchFeedback = onClick, visible = true, @@ -50,7 +52,11 @@ export default class Container extends AbstractContainer { touchFeedback ? TouchableHighlight : TouchableWithoutFeedback, - { onPress: onClick }, + { + accessibilityLabel, + accessible, + onPress: onClick + }, element); } diff --git a/react/features/conference/components/Conference.native.js b/react/features/conference/components/Conference.native.js index 2d0ed8e7ff..eb34dabc0a 100644 --- a/react/features/conference/components/Conference.native.js +++ b/react/features/conference/components/Conference.native.js @@ -175,6 +175,8 @@ class Conference extends Component { render() { return ( diff --git a/react/features/toolbox/components/ToolbarButton.native.js b/react/features/toolbox/components/ToolbarButton.native.js index c24ca92d4f..3c1475e367 100644 --- a/react/features/toolbox/components/ToolbarButton.native.js +++ b/react/features/toolbox/components/ToolbarButton.native.js @@ -38,6 +38,8 @@ class ToolbarButton extends AbstractToolbarButton { _renderButton(children) { const props = {}; + 'accessibilityLabel' in this.props + && (props.accessibilityLabel = this.props.accessibilityLabel); 'disabled' in this.props && (props.disabled = this.props.disabled); 'onClick' in this.props && (props.onPress = this._onClick); 'style' in this.props && (props.style = this.props.style); diff --git a/react/features/toolbox/components/Toolbox.native.js b/react/features/toolbox/components/Toolbox.native.js index a6cbc52e08..f50e4e180c 100644 --- a/react/features/toolbox/components/Toolbox.native.js +++ b/react/features/toolbox/components/Toolbox.native.js @@ -243,6 +243,7 @@ class Toolbox extends Component { onClick = { this._onToggleAudio } style = { audioButtonStyles.style } />