Skip to content

Commit 3bf0b7c

Browse files
committed
remove flex:1 from selectStyle to make the CSS work with RN39.
- versions of react native < 0.39.0 should pass flex:1 explicitly to selectStyle as a prop. - Update Readme to reflect selectStyle prop change for RN 0.39.
1 parent 00189fd commit 3bf0b7c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ class SampleApp extends Component {
6767
data={data}
6868
initValue="Select something yummy!"
6969
onChange={(option)=>{ this.setState({textInputValue:option.label})}}>
70-
70+
7171
<TextInput
7272
style={{borderWidth:1, borderColor:'#ccc', padding:10, height:30}}
7373
editable={false}
7474
placeholder="Select something yummy!"
7575
value={this.state.textInputValue} />
76-
76+
7777
</ModalPicker>
7878
</View>
7979
);
@@ -88,7 +88,8 @@ class SampleApp extends Component {
8888
* `onChange - function` optional, callback function, when the users has selected an option
8989
* `initValue - string` optional, text that is initially shown on the button
9090
* `cancelText - string` optional, text of the cancel button
91-
* `selectStyle - object` optional, style definitions for the select element (available in default mode only!)
91+
* `selectStyle - object` optional, style definitions for the select element (available in default mode only!).
92+
NOTE: Due to breaking changes in React Native, RN < 0.39.0 should pass `flex:1` explicitly to `selectStyle` as a prop.
9293
* `selectTextStyle - object` optional, style definitions for the select element (available in default mode only!)
9394
* `overlayStyle - object` optional, style definitions for the overly/background element
9495
* `sectionStyle - object` optional, style definitions for the section element

style.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export default StyleSheet.create({
3232
},
3333

3434
selectStyle: {
35-
flex: 1,
3635
borderColor: '#ccc',
3736
borderWidth: 1,
3837
padding: PADDING,

0 commit comments

Comments
 (0)