Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) Apply bottomOffset when keyboard is shown #2361

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

joecampo
Copy link
Contributor

@joecampo joecampo commented Mar 21, 2023

Applying the bottomOffset prop was inadvertently removed in the PR to remove the react-safe-area-context dependency #2353 The bottomOffset props is often used when using React Navigation tabs for iOS to remove the gap created between the input/chat and keyboard. This PR restores the previous functionality of the bottomOffset prop.

Prior to this PR the bottomOffset prop was always applied when the onKeyboardWillShow event was fired. This happened regardless if gifted chat was wrapped in a safe area or not.

this.setBottomOffset(this.safeAreaSupport(this.props.bottomOffset))

safeAreaSupport = (bottomOffset?: number) => {
return bottomOffset != null ? bottomOffset : 1
}

I've reviewed this with the PR author amerikan (Thanks again for getting rid of this dependency!), and we both agree that this PR would resolve & restore the previous behavior.

@amerikan
Copy link
Contributor

@Johan-dutoit can we merge this and maybe release a patch version, 2.0.1 or something. I overlooked one part in my previous PR that caused a regression in one of the props. @joecampo has found the problem and has the solution in this PR, which looks solid to me.

@Johan-dutoit Johan-dutoit merged commit 72e0b14 into FaridSafi:master Mar 23, 2023
@andreas-bergstrom
Copy link

Newcomer to this lib, had to dig through some issues to find the cause of the gap. Should it perhaps be highlighted in the "Questions" section as anyone using bottom tabs from React Navigation / Expo Router will run into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants