Skip to content

Commit

Permalink
fix: bottom offset issue
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelmagied94 authored and xcarpentier committed Jul 1, 2020
1 parent 2a89b68 commit 947f000
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/GiftedChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -583,12 +583,8 @@ class GiftedChat<TMessage extends IMessage = IMessage> extends React.Component<
)
}

safeAreaSupport = (bottomOffset: number) => {
return bottomOffset === this._bottomOffset
? this.getBottomOffset()
? this.getBottomOffset()
: getBottomSpace()
: bottomOffset
safeAreaSupport = (bottomOffset?: number) => {
return bottomOffset != null ? bottomOffset : getBottomSpace()
}

onKeyboardWillShow = (e: any) => {
Expand All @@ -597,7 +593,7 @@ class GiftedChat<TMessage extends IMessage = IMessage> extends React.Component<
this.setKeyboardHeight(
e.endCoordinates ? e.endCoordinates.height : e.end.height,
)
this.setBottomOffset(this.safeAreaSupport(this.props.bottomOffset!))
this.setBottomOffset(this.safeAreaSupport(this.props.bottomOffset))
const newMessagesContainerHeight = this.getMessagesContainerHeightWithKeyboard()
this.setState({
messagesContainerHeight: newMessagesContainerHeight,
Expand Down

0 comments on commit 947f000

Please sign in to comment.