Skip to content

Commit 6448608

Browse files
committed
RNTester: only show the Flatlist keyboard navigation switch on macOS
1 parent 22ad6a8 commit 6448608

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

packages/rn-tester/js/components/ListExampleShared.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,18 @@ const styles = StyleSheet.create({
359359
},
360360
// [TODO(macOS GH#774)
361361
selectedItem: {
362-
backgroundColor: PlatformColor('selectedContentBackgroundColor'),
362+
backgroundColor: Platform.select({
363+
macos: PlatformColor('selectedContentBackgroundColor'),
364+
default: 'blue',
365+
}),
363366
},
364367
selectedItemText: {
365368
// This was the closest UI Element color that looked right...
366369
// https://developer.apple.com/documentation/appkit/nscolor/ui_element_colors
367-
color: PlatformColor('selectedMenuItemTextColor'),
370+
color: Platform.select({
371+
macos: PlatformColor('selectedMenuItemTextColor'),
372+
default: 'white',
373+
}),
368374
},
369375
// [TODO(macOS GH#774)]
370376
});

packages/rn-tester/js/examples/FlatList/FlatList-basic.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,12 @@ class FlatListExample extends React.PureComponent<Props, State> {
185185
this._setBooleanValue('useFlatListItemComponent'),
186186
)}
187187
{/* [TODO(macOS GH#774) */}
188-
{renderSmallSwitchOption(
189-
'Keyboard Navigation',
190-
this.state.enableSelectionOnKeyPress,
191-
this._setBooleanValue('enableSelectionOnKeyPress'),
192-
)}
188+
{Platform.OS === 'macos' &&
189+
renderSmallSwitchOption(
190+
'Keyboard Navigation',
191+
this.state.enableSelectionOnKeyPress,
192+
this._setBooleanValue('enableSelectionOnKeyPress'),
193+
)}
193194
{/* TODO(macOS GH#774)] */}
194195
{Platform.OS === 'android' && (
195196
<View>

0 commit comments

Comments
 (0)