@@ -716,26 +716,28 @@ class AccessibilityActionsExample extends React.Component<{}> {
716
716
/>
717
717
</ RNTesterBlock >
718
718
719
- < RNTesterBlock title = "Text with custom accessibility actions" >
720
- < Text
721
- accessible = { true }
722
- accessibilityActions = { [
723
- { name : 'activate' , label : 'activate label' } ,
724
- { name : 'copy' , label : 'copy label' } ,
725
- ] }
726
- onAccessibilityAction = { event => {
727
- switch ( event . nativeEvent . actionName ) {
728
- case 'activate' :
729
- Alert . alert ( 'Alert' , 'Activate accessiblity action' ) ;
730
- break ;
731
- case 'copy' :
732
- Alert . alert ( 'Alert' , 'copy action success' ) ;
733
- break ;
734
- }
735
- } } >
736
- Text
737
- </ Text >
738
- </ RNTesterBlock >
719
+ { /* TODO(macOS GH#774) - This doesn't work, see https://github.com/facebook/react-native/issues/32616
720
+ <RNTesterBlock title="Text with custom accessibility actions">
721
+ <Text
722
+ accessible={true}
723
+ accessibilityActions={[
724
+ {name: 'activate', label: 'activate label'},
725
+ {name: 'copy', label: 'copy label'},
726
+ ]}
727
+ onAccessibilityAction={event => {
728
+ switch (event.nativeEvent.actionName) {
729
+ case 'activate':
730
+ Alert.alert('Alert', 'Activate accessiblity action');
731
+ break;
732
+ case 'copy':
733
+ Alert.alert('Alert', 'copy action success');
734
+ break;
735
+ }
736
+ }}>
737
+ Text
738
+ </Text>
739
+ </RNTesterBlock>
740
+ */ }
739
741
</ View >
740
742
) ;
741
743
}
@@ -962,15 +964,22 @@ class EnabledExamples extends React.Component<{}> {
962
964
}
963
965
// [TODO(OSS Candidate ISS#2710739)
964
966
type DisplayOptionsStatusExampleState = {
965
- highContrastEnabled : boolean ,
966
- invertColorsEnabled : boolean ,
967
- reduceMotionEnabled : boolean ,
968
- reduceTransparencyEnabled : boolean ,
967
+ highContrastEnabled ? : boolean ,
968
+ invertColorsEnabled ? : boolean ,
969
+ reduceMotionEnabled ? : boolean ,
970
+ reduceTransparencyEnabled ? : boolean ,
969
971
} ;
970
972
class DisplayOptionsStatusExample extends React . Component <
971
973
{ } ,
972
974
DisplayOptionsStatusExampleState ,
973
975
> {
976
+ state : DisplayOptionsStatusExampleState = {
977
+ highContrastEnabled : undefined ,
978
+ invertColorsEnabled : undefined ,
979
+ reduceMotionEnabled : undefined ,
980
+ reduceTransparencyEnabled : undefined ,
981
+ } ;
982
+
974
983
componentDidMount ( ) {
975
984
AccessibilityInfo . addEventListener (
976
985
'highContrastChanged' ,
@@ -1056,31 +1065,40 @@ class DisplayOptionsStatusExample extends React.Component<
1056
1065
} ) ;
1057
1066
} ;
1058
1067
1068
+ // TODO(macOS GH#774) - slight refactoring to allow state to handle undefined values
1069
+ _statusString = isEnabled => {
1070
+ if ( isEnabled !== undefined ) {
1071
+ return isEnabled ? 'enabled ' : 'disabled ';
1072
+ } else {
1073
+ return 'unknown ';
1074
+ }
1075
+ } ;
1076
+
1059
1077
render ( ) : React . Node {
1060
1078
return (
1061
1079
< View >
1062
1080
< View >
1063
1081
< Text >
1064
1082
High contrast is{ ' ' }
1065
- { this . state . highContrastEnabled ? 'enabled' : 'disabled' } .
1083
+ { this . _statusString ( this . state . highContrastEnabled ) } .
1066
1084
</ Text >
1067
1085
</ View >
1068
1086
< View >
1069
1087
< Text >
1070
1088
Invert colors is{ ' ' }
1071
- { this . state . invertColorsEnabled ? 'enabled' : 'disabled' } .
1089
+ { this . _statusString ( this . state . invertColorsEnabled ) } .
1072
1090
</ Text >
1073
1091
</ View >
1074
1092
< View >
1075
1093
< Text >
1076
1094
Reduce motion is{ ' ' }
1077
- { this . state . reduceMotionEnabled ? 'enabled' : 'disabled' } .
1095
+ { this . _statusString ( this . state . reduceMotionEnabled ) } .
1078
1096
</ Text >
1079
1097
</ View >
1080
1098
< View >
1081
1099
< Text >
1082
1100
Reduce transparency is{ ' ' }
1083
- { this . state . reduceTransparencyEnabled ? 'enabled' : 'disabled' } .
1101
+ { this . _statusString ( this . state . reduceTransparencyEnabled ) } .
1084
1102
</ Text >
1085
1103
</ View >
1086
1104
</ View >
0 commit comments