cooperka / react-native-snackbar

:candy: Material Design "Snackbar" component for Android and iOS.
Other
816 stars 150 forks source link

Snackbar rendering behind keyboard on iOS #78

Open johakr opened 6 years ago

johakr commented 6 years ago

Hi,

on iOS the snackbar always renders on the bottom behind the keyboard if keyboard is open. Is this intended behavior / a known limitation?

cooperka commented 6 years ago

Hi @johakr, this is not intended behavior and should be fixed. It should be possible to account for the keyboard height. I'm happy to accept a PR for this.

jdrorrer commented 6 years ago

@johakr one fix could be to import { Keyboard } from 'react-native' and call Keyboard.dismiss() when a certain event handler is called. Here's more info: https://facebook.github.io/react-native/docs/keyboard.html

faisalkhan1690 commented 5 years ago

@jdrorrer Thanks for this workaround it really saved my day.

cooperka commented 5 years ago

Hi @faisalkhan1690, I saw you posted #105 about this happening on Android also. Can you post any screenshots or an app to repro this? It uses the native Android Snackbar component so this shouldn't be happening unless something weird is going on like the Snackbar getting attached to a non-main view.

rahulchowdhury commented 5 years ago

Any updates on this issue?

cooperka commented 4 years ago

@rahulchowdhury no updates, do you have time to help out and submit a PR?

rahulchowdhury commented 4 years ago

Hey @cooperka, sorry mate, I'm not a React dev. Found this issue when I contributed once to a project inside the company I work for.

I'll ask the concerned developer to have a look at this. 😀

ravi-roxiler commented 3 months ago

We can use marginBottom props and pass the value by importing keyboard property from react-native import {Keyboard} from 'react-native' and use as marginBottom: Keyboard.metrics()?.height.