Open Hitarthbhatt opened 2 years ago
same issue i am facing
@Hitarthbhatt @Jigs6720 I tested it, and it works correctly. Could you please share your React Native version as well as the version of the library you are using?
I have the same issue.
In my case it is related to setting android:windowSoftInputMode
to pan
instead of resize
.
The toast is above keyboard with resize
and behind with pan
.
I need the pan
option for other reasons.
I tried to use a custom layout with KeyboardAvoidingView
but it changes nothing.
Any idea would be great help, thanks !
@Hitarthbhatt @Jigs6720 Did you guys found out any solution?
@moooss Doing this android:windowSoftInputMode="stateAlwaysHidden|adjustResize" is flickering the screen when opened the keyboard.
Hey! Using https://www.npmjs.com/package/patch-package to modify the code like is shown bellow seemed to to the trick.
--- a/node_modules/react-native-toast-message/lib/src/hooks/useKeyboard.js
+++ b/node_modules/react-native-toast-message/lib/src/hooks/useKeyboard.js
@@ -1,6 +1,5 @@
import React from 'react';
import { Keyboard } from 'react-native';
-import { isIOS } from '../utils/platform';
export function useKeyboard() {
const [keyboardHeight, setKeyboardHeight] = React.useState(0);
const [isKeyboardVisible, setIsKeyboardVisible] = React.useState(false);
@@ -14,9 +13,6 @@ export function useKeyboard() {
setIsKeyboardVisible(false);
}, []);
React.useEffect(() => {
- if (!isIOS()) {
- return () => { };
- }
const didShowListener = Keyboard.addListener('keyboardDidShow', onShow);
const didHideListener = Keyboard.addListener('keyboardDidHide', onHide);
return () => {
That way the Toast on Android is also keyboard aware. If you then play around with the bottomOffset
and keyboardOffset
with different values for each platform you can get it right.
@seyedmostafahasani do you know why is there a guard for (not) iOS?
When keyboard is up and toast position is bottom, it's covered by keyboard! Is it possible to come upon keyboard view? (Specific Android Device)