Skip to content

Commit

Permalink
fix(keyboard height): fix on android & expo TextInput no show
Browse files Browse the repository at this point in the history
* adding forceGetKeyboardHeight props
* fixes FaridSafi/react-native-gifted-chat#461
  • Loading branch information
Dolloong committed Sep 26, 2017
1 parent c3db6c0 commit 7c7ec61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/GiftedChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class GiftedChat extends React.Component {
}

getKeyboardHeight() {
if (Platform.OS === 'android') {
if (Platform.OS === 'android' && !this.props.forceGetKeyboardHeight) {
// For android: on-screen keyboard resized main container and has own height.
// @see https://developer.android.com/training/keyboard-input/visibility.html
// So for calculate the messages container height ignore keyboard height.
Expand Down Expand Up @@ -554,6 +554,7 @@ GiftedChat.defaultProps = {
}),
onInputTextChanged: null,
maxInputLength: null,
forceGetKeyboardHeight: false,
};

GiftedChat.propTypes = {
Expand Down Expand Up @@ -600,6 +601,7 @@ GiftedChat.propTypes = {
keyboardShouldPersistTaps: PropTypes.oneOf(['always', 'never', 'handled']),
onInputTextChanged: PropTypes.func,
maxInputLength: PropTypes.number,
forceGetKeyboardHeight: PropTypes.bool,
};

export {
Expand Down

0 comments on commit 7c7ec61

Please sign in to comment.