-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text Component does not announce "disabled" #30937 #1
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Test Cases
<TouchableNativeFeedback accessibilityState={{disabled: true}}>
<Text>TouchableNativeFeedback</Text>
</TouchableNativeFeedback> Expected Result:
Actual Result:
NOTES:
The problems does not reproduce with the View Component
<TouchableNativeFeedback accessibilityState={{disabled: true}}>
<Text>TouchableNativeFeedback</Text>
</TouchableNativeFeedback> renders <Text>TouchableNativeFeedback</Text> <TouchableNativeFeedback accessibilityState={{disabled: true}}>
<View>
<Text>TouchableNativeFeedback</Text>
</View>
</TouchableNativeFeedback> renders <View><Text>TouchableNativeFeedback</Text></View> CLICK TO OPEN TESTS RESULTS
2022-02-04.11-44-09.mp4 |
Test Cases
<TouchableNativeFeedback accessibilityState={{disabled: true}}>
<View>
<Text>TouchableNativeFeedback</Text>
</View>
</TouchableNativeFeedback> Expected/Actual Result:
CLICK TO OPEN TESTS RESULTS
2022-02-04.11-50-25.mp4 |
Test Cases
<View
focusable={true}
style={{backgroundColor: 'red', height: 100, width: 100}}
accessibilityState={{disabled: true}}>
<Text style={{backgroundColor: 'green', color: 'white'}}>
This is a View and it has an accessibilityState
</Text>
</View> Expected/Actual Result:
NOTES:
CLICK TO OPEN TESTS RESULTS
2022-02-04.12-35-09.mp4 |
Test Cases
<Text accessibilityState={{disabled: true}}>This is a Text Example</Text> Adding the prop @ReactProp(name = "accessible")
public void setAccessible(ReactTextView view, boolean accessible) {
view.setFocusable(accessible);
} Expected/Actual Result:
CLICK TO OPEN TESTS RESULTS
2022-02-04.13-16-28.mp4 |
TO-DO:
Fix PR to handle edge case:
Edge Cases
Low Priority
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Adding the prop `accessible` to `ReactTextAnchorViewManager` fixes the problem for this component. The same solution from my previous pr facebook#30935 (comment). See test case at fabOnReact/react-native-notes#1 (comment)
Test Cases 7.6. Text has <Text
onPress={() => console.warn('onPress')}
accessibilityState={{disabled: true}}>
Awesome App
</Text> Expected Result: Actual Result: Related facebook/react-native#30947 Fixed with commits facebook/react-native@6ab7ab3 fabOnReact/react-native@17095c6 CLICK TO OPEN TESTS RESULTS - ON PR BRANCH BEFORE COMMIT 1c4f98dd
On PR Branch before commit 1c4f98dd the user is allowed to click on the text and trigger the testcase15.mp4CLICK TO OPEN TESTS RESULTS - MAIN BRANCH
testcase15onmain.mp4 |
Adding the prop `accessible` to `ReactTextAnchorViewManager` fixes the problem for this component. The same solution from my previous pr facebook#30935 (comment). See test case at fabOnReact/react-native-notes#1 (comment) 666647e
This comment was marked as outdated.
This comment was marked as outdated.
Test Cases
CLICK TO OPEN SOURCECODE
<Text
style={styles.text}
onPress={() => console.warn('onPress')}
disabled
accessibilityState={{disabled: false}}>
This is a Text
</Text> Expected/Actual Result: CLICK TO OPEN TESTS RESULTS
testcase1.mp4 |
Test Cases
CLICK TO OPEN SOURCECODE
<Text
style={styles.text}
onPress={() => console.warn('onPress')}
disabled>
This is a Text
</Text> Expected/Actual Result:
CLICK TO OPEN TESTS RESULTS
testcase2.mp4 |
Test Cases
CLICK TO OPEN SOURCECODE
<Text
style={styles.text}
onPress={() => console.warn('onPress')}
accessibilityState={{disabled: true}}>
This is a Text
</Text> Expected/Actual Result:
CLICK TO OPEN TESTS RESULTS
testcase3.mp4 |
Test Cases
CLICK TO OPEN SOURCECODE
<Text
style={styles.text}
onPress={() => console.warn('onPress')}
accessibilityState={{disabled: false}}>
This is a Text
</Text> Expected/Actual Result:
CLICK TO OPEN TESTS RESULTS
testcase4.mp4 |
Test Cases
CLICK TO OPEN SOURCECODE
<Text
style={styles.text}
onPress={() => console.warn('onPress')}
disabled={false}
accessibilityState={{disabled: true}}>
This is a Text
</Text> Expected/Actual Result: CLICK TO OPEN TESTS RESULTS
testcase5.mp4 |
Test Cases 7.1 Text has CLICK TO OPEN SOURCECODE
<Text
style={styles.text}
onPress={() => console.warn('onPress')}
disabled
accessibilityState={{disabled: false}}>
This is a Text
</Text> Expected Result: Actual Result: CLICK TO OPEN TESTS RESULTS
testcase7-1.mp4 |
Test Cases 7.3. Text has CLICK TO OPEN SOURCECODE
<Text
style={styles.text}
onPress={() => console.warn('onPress')}
accessibilityState={{disabled: true}}>
This is a Text
</Text> Expected Result:
Actual Result:
CLICK TO OPEN TESTS RESULTS
testcase7-3.mp4 |
Test Cases 7.5 Text has CLICK TO OPEN SOURCECODE
<Text
style={styles.text}
onPress={() => console.warn('onPress')}
disabled={false}
accessibilityState={{disabled: true}}>
This is a Text
</Text> Expected Result: Actual Result:
CLICK TO OPEN TESTS RESULTS
testcase7-5.mp4 |
SummaryThis issue fixes facebook/react-native#30937 facebook/react-native#30947 (Test Case 7.1, Test Case 7.3, Test Case 7.5) .
Related PRs facebook/react-native#33070 callstack/react-native-slider#354 Changelog[General] [Fixed] - Text Component does not announce and disable click functionality when disabled Test Plan1. Text has |
Test Cases 7.7 Text has Without the below logic in ReactTextAnchorViewManager (added in commit facebook/react-native@17095c6). @ReactProp(name = "accessible")
public void setAccessible(ReactTextView view, boolean accessible) {
view.setFocusable(accessible);
} CLICK TO OPEN SOURCECODE
<Text accessibilityState={{disabled: true}}>
This is a Text
</Text> Expected Result: Actual Result:
CLICK TO OPEN TESTS RESULTS
notAnnounceDisabled.mp4 |
Test Cases
With the below logic in ReactTextAnchorViewManager. @ReactProp(name = "accessible")
public void setAccessible(ReactTextView view, boolean accessible) {
view.setFocusable(accessible);
} CLICK TO OPEN SOURCECODE
<Text accessibilityState={{disabled: true}}>
This is a Text
</Text> Expected/Actual Result: CLICK TO OPEN TESTS RESULTS
announcesDisabled.mp4 |
…ality when disabled (#33076) Summary: This issue fixes #30937 fixes #30947 fixes #30840 ([Test Case 7.1][7.1], [Test Case 7.3][7.3], [Test Case 7.5][7.5]) . The issue is caused by: 1) The missing javascript logic on the `accessibilityState` in the Text component fabOnReact@6ab7ab3 (as previously implemented in [Button][20]). 2) The missing setter for prop `accessible` in `ReactTextAnchorViewManager` fabOnReact@17095c6 (More information in previous PR #31252) Related PR #33070 PR callstack/react-native-slider#354 [20]: https://github.com/facebook/react-native/pull/31001/files#diff-4f225d043edf4cf5b8288285b6a957e2187fc0242f240bde396e41c4c25e4124R281-R289 ## Changelog [Android] [Fixed] - Text Component does not announce disabled and disables click functionality when disabled Pull Request resolved: #33076 Test Plan: [1]. Text has `disabled` and `accessibilityState={{disabled: false}}` ([link][1]) [2]. Text has `disabled` ([link][2]) [3]. Text has `accessibilityState={{disabled: true}}` ([link][3]) [4]. Text has `accessibilityState={{disabled:false}}` ([link][4]) [5]. Text has `disabled={false}` and `accessibilityState={{disabled:true}}` ([link][5]) [6]. Text has `accessibilityState={{disabled:true}}` and method `setAccessible` in `ReactTextAnchorViewManager` (tested on commit [b4cd8][10]) ([link][6]) 7. Test Cases on the main branch [7.1]. Text has `disabled` and `accessibilityState={{disabled: false}}` ([link][7.1]) [7.3] Text has `accessibilityState={{disabled: true}}` ([link][7.3]) [7.5] Text has `disabled={false}` and `accessibilityState={{disabled:true}}` ([link][7.5]) [7.6] Text has `onPress callback` and `accessibilityState={{disabled: true}}` ([link][7.6]) [7.7] Text has `accessibilityState={{disabled:true}}` and no method `setAccessible` in `ReactTextAnchorViewManager` (tested on commit [c4f98dd][11]) ([link][7.7]) [1]: fabOnReact/react-native-notes#1 (comment) [2]: fabOnReact/react-native-notes#1 (comment) [3]: fabOnReact/react-native-notes#1 (comment) [4]: fabOnReact/react-native-notes#1 (comment) [5]: fabOnReact/react-native-notes#1 (comment) [6]: fabOnReact/react-native-notes#1 (comment) [7.1]: fabOnReact/react-native-notes#1 (comment) [7.3]: fabOnReact/react-native-notes#1 (comment) [7.5]: fabOnReact/react-native-notes#1 (comment) [7.6]: fabOnReact/react-native-notes#1 (comment) [7.7]: fabOnReact/react-native-notes#1 (comment) [10]: 17095c6 [11]: 6ab7ab3 Reviewed By: blavalla Differential Revision: D34211793 Pulled By: ShikaSD fbshipit-source-id: e153fb48c194f5884e30beb9172e66aca7ce1a41
…ality when disabled (facebook#33076) Summary: This issue fixes facebook#30937 fixes facebook#30947 fixes facebook#30840 ([Test Case 7.1][7.1], [Test Case 7.3][7.3], [Test Case 7.5][7.5]) . The issue is caused by: 1) The missing javascript logic on the `accessibilityState` in the Text component fabOnReact@6ab7ab3 (as previously implemented in [Button][20]). 2) The missing setter for prop `accessible` in `ReactTextAnchorViewManager` fabOnReact@17095c6 (More information in previous PR facebook#31252) Related PR facebook#33070 PR callstack/react-native-slider#354 [20]: https://github.com/facebook/react-native/pull/31001/files#diff-4f225d043edf4cf5b8288285b6a957e2187fc0242f240bde396e41c4c25e4124R281-R289 [Android] [Fixed] - Text Component does not announce disabled and disables click functionality when disabled Pull Request resolved: facebook#33076 Test Plan: [1]. Text has `disabled` and `accessibilityState={{disabled: false}}` ([link][1]) [2]. Text has `disabled` ([link][2]) [3]. Text has `accessibilityState={{disabled: true}}` ([link][3]) [4]. Text has `accessibilityState={{disabled:false}}` ([link][4]) [5]. Text has `disabled={false}` and `accessibilityState={{disabled:true}}` ([link][5]) [6]. Text has `accessibilityState={{disabled:true}}` and method `setAccessible` in `ReactTextAnchorViewManager` (tested on commit [b4cd8][10]) ([link][6]) 7. Test Cases on the main branch [7.1]. Text has `disabled` and `accessibilityState={{disabled: false}}` ([link][7.1]) [7.3] Text has `accessibilityState={{disabled: true}}` ([link][7.3]) [7.5] Text has `disabled={false}` and `accessibilityState={{disabled:true}}` ([link][7.5]) [7.6] Text has `onPress callback` and `accessibilityState={{disabled: true}}` ([link][7.6]) [7.7] Text has `accessibilityState={{disabled:true}}` and no method `setAccessible` in `ReactTextAnchorViewManager` (tested on commit [c4f98dd][11]) ([link][7.7]) [1]: fabOnReact/react-native-notes#1 (comment) [2]: fabOnReact/react-native-notes#1 (comment) [3]: fabOnReact/react-native-notes#1 (comment) [4]: fabOnReact/react-native-notes#1 (comment) [5]: fabOnReact/react-native-notes#1 (comment) [6]: fabOnReact/react-native-notes#1 (comment) [7.1]: fabOnReact/react-native-notes#1 (comment) [7.3]: fabOnReact/react-native-notes#1 (comment) [7.5]: fabOnReact/react-native-notes#1 (comment) [7.6]: fabOnReact/react-native-notes#1 (comment) [7.7]: fabOnReact/react-native-notes#1 (comment) [10]: facebook@17095c6 [11]: facebook@6ab7ab3 Reviewed By: blavalla Differential Revision: D34211793 Pulled By: ShikaSD fbshipit-source-id: e153fb48c194f5884e30beb9172e66aca7ce1a41
facebook/react-native#30937
The text was updated successfully, but these errors were encountered: