Permalink
Browse files

Min composer height is not respecting props in some instances. Fixing…

… this issue (#1078)
  • Loading branch information...
nandiniparimi1107 authored and xcarpentier committed Jan 11, 2019
1 parent 837bbf2 commit f872d670bc93dc747a131a0ac49fdd8284b85c9a
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/GiftedChat.js
@@ -55,7 +55,7 @@ class GiftedChat extends React.Component {

this.state = {
isInitialized: false, // initialization will calculate maxHeight before rendering the chat
composerHeight: MIN_COMPOSER_HEIGHT,
composerHeight: this.props.minComposerHeight,
messagesContainerHeight: null,
typingDisabled: false,
};
@@ -222,7 +222,7 @@ class GiftedChat extends React.Component {
: this.props.minInputToolbarHeight;
}
calculateInputToolbarHeight(composerHeight) {
return composerHeight + (this.getMinInputToolbarHeight() - MIN_COMPOSER_HEIGHT);
return composerHeight + (this.getMinInputToolbarHeight() - this.props.minComposerHeight);
}

/**
@@ -357,7 +357,7 @@ class GiftedChat extends React.Component {
this.textInput.clear();
}
this.notifyInputTextReset();
const newComposerHeight = MIN_COMPOSER_HEIGHT;
const newComposerHeight = this.props.minComposerHeight;
const newMessagesContainerHeight = this.getMessagesContainerHeightWithKeyboard(newComposerHeight);
this.setState({
text: this.getTextFromProp(''),
@@ -412,7 +412,7 @@ class GiftedChat extends React.Component {
}
this.notifyInputTextReset();
this.setMaxHeight(layout.height);
const newComposerHeight = MIN_COMPOSER_HEIGHT;
const newComposerHeight = this.props.minComposerHeight;
const newMessagesContainerHeight = this.getMessagesContainerHeightWithKeyboard(newComposerHeight);
this.setState({
isInitialized: true,
@@ -440,7 +440,7 @@ class GiftedChat extends React.Component {
const inputToolbarProps = {
...this.props,
text: this.getTextFromProp(this.state.text),
composerHeight: Math.max(MIN_COMPOSER_HEIGHT, this.state.composerHeight),
composerHeight: Math.max(this.props.minComposerHeight, this.state.composerHeight),
onSend: this.onSend,
onInputSizeChanged: this.onInputSizeChanged,
onTextChanged: this.onInputTextChanged,

0 comments on commit f872d67

Please sign in to comment.