Skip to content

Commit 0804147

Browse files
authored
Changed the showsVerticalScrollIndicator and showsHorizontalScrollIndicator default values on macOS to match iOS and Android. (facebook#77)
Updated RNTesters filter text field to use mac semantic colors.
1 parent 46afff8 commit 0804147

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

RNTester/js/RNTesterExampleFilter.js

+29-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
'use strict';
1212

13+
const Platform = require('Platform'); // TODO(macOS ISS#2323203)
1314
const React = require('react');
1415
const StyleSheet = require('StyleSheet');
1516
const TextInput = require('TextInput');
@@ -77,6 +78,11 @@ class RNTesterExampleFilter extends React.Component<Props, State> {
7778
this.setState(() => ({filter: text}));
7879
}}
7980
placeholder="Search..."
81+
placeholderTextColor={
82+
Platform.OS === 'macos'
83+
? {semantic: 'placeholderTextColor'}
84+
: undefined /*TODO(macOS ISS#2323203)*/
85+
}
8086
underlineColorAndroid="transparent"
8187
style={styles.searchTextInput}
8288
testID="explorer_search"
@@ -89,12 +95,32 @@ class RNTesterExampleFilter extends React.Component<Props, State> {
8995

9096
const styles = StyleSheet.create({
9197
searchRow: {
92-
backgroundColor: '#eeeeee',
98+
// [TODO(macOS ISS#2323203)
99+
...Platform.select({
100+
macos: {
101+
backgroundColor: {semantic: 'windowBackgroundColor'},
102+
},
103+
default: {
104+
// ]TODO(macOS ISS#2323203)
105+
backgroundColor: '#eeeeee',
106+
}, // [TODO(macOS ISS#2323203)
107+
}), // ]TODO(macOS ISS#2323203)
93108
padding: 10,
94109
},
95110
searchTextInput: {
96-
backgroundColor: 'white',
97-
borderColor: '#cccccc',
111+
// [TODO(macOS ISS#2323203)
112+
...Platform.select({
113+
macos: {
114+
color: {semantic: 'textColor'},
115+
backgroundColor: {semantic: 'textBackgroundColor'},
116+
borderColor: {semantic: 'quaternaryLabelColor'},
117+
},
118+
default: {
119+
// ]TODO(macOS ISS#2323203)
120+
backgroundColor: 'white',
121+
borderColor: '#cccccc',
122+
}, // [TODO(macOS ISS#2323203)
123+
}), // ]TODO(macOS ISS#2323203)
98124
borderRadius: 3,
99125
borderWidth: 1,
100126
paddingLeft: 8,

React/Views/ScrollView/RCTScrollView.m

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ - (instancetype)initWithFrame:(CGRect)frame
185185
if ((self = [super initWithFrame:frame])) {
186186
#if TARGET_OS_OSX // [TODO(macOS ISS#2323203)
187187
self.scrollEnabled = YES;
188+
self.hasHorizontalScroller = YES;
189+
self.hasVerticalScroller = YES;
188190
self.panGestureRecognizer = [[NSPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleCustomPan:)];
189191
#else // ]TODO(macOS ISS#2323203)
190192
[self.panGestureRecognizer addTarget:self action:@selector(handleCustomPan:)];

0 commit comments

Comments
 (0)