File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,15 @@ export function PickerAvoidingView(props) {
37
37
}
38
38
} , [ isPickerOpen ] ) ;
39
39
40
- return (
41
- < View
42
- style = { StyleSheet . compose ( props . style , {
43
- paddingBottom : shouldAddSpace ? IOS_MODAL_HEIGHT : 0 ,
44
- } ) }
45
- >
46
- { props . children }
47
- </ View >
48
- ) ;
40
+ const style = props . enabled
41
+ ? StyleSheet . compose ( props . style , {
42
+ paddingBottom : shouldAddSpace ? IOS_MODAL_HEIGHT : 0 ,
43
+ } )
44
+ : props . style ;
45
+
46
+ return < View style = { style } > { props . children } </ View > ;
49
47
}
48
+
49
+ PickerAvoidingView . defaultProps = {
50
+ enabled : true ,
51
+ } ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { View } from " react-native" ;
2
+ import { View } from ' react-native' ;
3
3
4
4
/**
5
5
* As, currently, only on iOS the picker's modal resembles the software keyboard
@@ -9,5 +9,7 @@ import { View } from "react-native";
9
9
* within the PickerAvoidingView.
10
10
*/
11
11
export function PickerAvoidingView ( props ) {
12
- return < View { ...props } > { props . children } </ View > ;
12
+ // eslint-disable-next-line no-unused-vars
13
+ const { enabled, ...viewProps } = props ;
14
+ return < View { ...viewProps } > { props . children } </ View > ;
13
15
}
You can’t perform that action at this time.
0 commit comments