Skip to content

Commit 44b6637

Browse files
authored
Merge pull request #10567 from Expensify/Rory-ScreenWrapperBehavior
Use defaultProps instead of hardcoded value
2 parents e6b6dd2 + b0807d5 commit 44b6637

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/components/ScreenWrapper/index.android.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ const ScreenWrapper = props => (
66
<BaseScreenWrapper
77
// eslint-disable-next-line react/jsx-props-no-spreading
88
{...props}
9-
keyboardAvoidingViewBehavior="height"
109
>
1110
{props.children}
1211
</BaseScreenWrapper>
1312
);
13+
14+
defaultProps.keyboardAvoidingViewBehavior = 'height';
15+
1416
ScreenWrapper.propTypes = propTypes;
1517
ScreenWrapper.defaultProps = defaultProps;
1618

src/pages/home/ReportScreen.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import {withOnyx} from 'react-native-onyx';
33
import PropTypes from 'prop-types';
4-
import {Keyboard, View} from 'react-native';
4+
import {Keyboard, Platform, View} from 'react-native';
55
import lodashGet from 'lodash/get';
66
import _ from 'underscore';
77
import lodashFindLast from 'lodash/findLast';
@@ -227,7 +227,10 @@ class ReportScreen extends React.Component {
227227
reportClosedAction = lodashFindLast(this.props.reportActions, action => action.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED);
228228
}
229229
return (
230-
<ScreenWrapper style={[styles.appContent, styles.flex1, {marginTop: this.state.viewportOffsetTop}]}>
230+
<ScreenWrapper
231+
style={[styles.appContent, styles.flex1, {marginTop: this.state.viewportOffsetTop}]}
232+
keyboardAvoidingViewBehavior={Platform.OS === 'android' ? '' : 'padding'}
233+
>
231234
<HeaderView
232235
reportID={reportID}
233236
onNavigationMenuButtonClicked={() => Navigation.navigate(ROUTES.HOME)}

0 commit comments

Comments
 (0)