react-native-snackbar icon indicating copy to clipboard operation
react-native-snackbar copied to clipboard

Snackbar rendering behind keyboard on iOS

Open johakr opened this issue 7 years ago • 8 comments

Hi,

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

johakr avatar May 17 '18 10:05 johakr

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.

cooperka avatar May 19 '18 17:05 cooperka

@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

jdrorrer avatar Jul 13 '18 19:07 jdrorrer

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

faisalkhan1690 avatar Feb 21 '19 08:02 faisalkhan1690

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.

cooperka avatar Feb 21 '19 17:02 cooperka

Any updates on this issue?

rahulchowdhury avatar Jul 16 '19 12:07 rahulchowdhury

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

cooperka avatar Jul 30 '19 23:07 cooperka

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. 😀

rahulchowdhury avatar Jul 31 '19 06:07 rahulchowdhury

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.

ravi-roxiler avatar Apr 18 '24 08:04 ravi-roxiler