Преглед изворни кода

React Native accessibility fixes (#5825)

* Accessibility: Make the native toolbox item communicate that it is a button.

* Accessibility: If an item is toggled, mark it as selected for accessibility

* Accessibility: Make the toolbox a toolbar for accessibility

* Accessibility: Mark the bottom sheet as a menu for accessibility

* Fix typo, AccessibilityRole, not AccessibleRole

* Statement fix

* Appease the linter

* Fix linting errors for real this time
master
Marco Zehe пре 5 година
родитељ
комит
e32f367b0c
No account linked to committer's email address

+ 2
- 0
react/features/base/dialog/components/native/BottomSheet.js Прегледај датотеку

84
 
84
 
85
         return (
85
         return (
86
             <SlidingView
86
             <SlidingView
87
+                accessibilityRole = 'menu'
88
+                accessibilityViewIsModal = { true }
87
                 onHide = { this.props.onCancel }
89
                 onHide = { this.props.onCancel }
88
                 position = 'bottom'
90
                 position = 'bottom'
89
                 show = { true }>
91
                 show = { true }>

+ 4
- 1
react/features/base/toolbox/components/ToolboxItem.native.js Прегледај датотеку

41
             elementAfter,
41
             elementAfter,
42
             onClick,
42
             onClick,
43
             showLabel,
43
             showLabel,
44
-            styles
44
+            styles,
45
+            toggled
45
         } = this.props;
46
         } = this.props;
46
 
47
 
47
         let children = this._renderIcon();
48
         let children = this._renderIcon();
72
         return (
73
         return (
73
             <TouchableHighlight
74
             <TouchableHighlight
74
                 accessibilityLabel = { this.accessibilityLabel }
75
                 accessibilityLabel = { this.accessibilityLabel }
76
+                accessibilityRole = 'button'
77
+                accessibilityState = {{ 'selected': toggled }}
75
                 disabled = { disabled }
78
                 disabled = { disabled }
76
                 onPress = { onClick }
79
                 onPress = { onClick }
77
                 style = { style }
80
                 style = { style }

+ 1
- 0
react/features/toolbox/components/native/Toolbox.js Прегледај датотеку

110
 
110
 
111
         return (
111
         return (
112
             <View
112
             <View
113
+                accessibilityRole = 'toolbar'
113
                 pointerEvents = 'box-none'
114
                 pointerEvents = 'box-none'
114
                 style = { styles.toolbar }>
115
                 style = { styles.toolbar }>
115
                 {
116
                 {

Loading…
Откажи
Сачувај