Skip to content

Commit

Permalink
feature: added statusBar prop to indicate whether the height of it …
Browse files Browse the repository at this point in the history
…should be taken into account - fixes wix-incubator#14
  • Loading branch information
shakyShane committed May 24, 2017
1 parent e3c4db5 commit 37db7cc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/KeyboardAwareScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ import KeyboardAwareBase from './KeyboardAwareBase'

export default class KeyboardAwareScrollView extends KeyboardAwareBase {
render() {
const contentInset = {
bottom: this.state.keyboardHeight,
top: this.props.statusBar ? -20 : 0
};
return (
<ScrollView {...this.props} {...this.style}
contentInset={{bottom: this.state.keyboardHeight}}
contentInset={contentInset}
ref={(r) => {
this._keyboardAwareView = r;
}}
Expand All @@ -34,7 +38,8 @@ export default class KeyboardAwareScrollView extends KeyboardAwareBase {

KeyboardAwareScrollView.propTypes = {
getTextInputRefs: PropTypes.func,
onScroll: PropTypes.func
onScroll: PropTypes.func,
statusBar: PropTypes.bool
};
KeyboardAwareScrollView.defaultProps = {
...KeyboardAwareBase.defaultProps,
Expand Down

0 comments on commit 37db7cc

Please sign in to comment.