hoaphantn7604 / react-native-curved-bottom-bar

A high performance, beautiful and fully customizable curved bottom navigation bar for React Native.
MIT License
485 stars 100 forks source link

tabBarHideOnKeyboard Not Working and Bottom Bar Goes Up with Keyboard #78

Open sandesh-wadal opened 2 months ago

sandesh-wadal commented 2 months ago

Hello,

I am experiencing an issue with the CurvedBottomBar.Navigator where the tabBarHideOnKeyboard screen option is not functioning as expected. Specifically, when the keyboard appears, the bottom bar is not hiding as it should. Instead, the bottom bar goes up along with the keyboard.

Steps to Reproduce: Set up a CurvedBottomBar.Navigator with tabBarHideOnKeyboard enabled in the screenOptions. Implement a screen where the keyboard is triggered (e.g., a text input field). Observe that when the keyboard appears, the bottom bar does not hide, and instead, it moves up with the keyboard.

Expected Behavior: The bottom bar should hide when the keyboard is visible, as specified by the tabBarHideOnKeyboard option.

Actual Behavior: The bottom bar moves up with the keyboard, not hiding as expected.

tried adding this in Navigator as well as in screen

<CurvedBottomBar.Navigator
    screenOptions={{
      headerShown: false,
      unmountOnBlur: true,
      tabBarHideOnKeyboard:true
    }}

     <CurvedBottomBar.Screen
    options={{
      tabBarHideOnKeyboard:true
    }}
victor-rayan commented 1 month ago

same here

dws-ronak commented 1 week ago

const tabRef = useRef(null); tabRef?.current?.setVisible(false),

@sandesh-wadal You can handle it manually using ref and Keyboard API of react native.

sandesh-wadal commented 6 days ago

@dws-ronak I am using ref to set visible true and false. using keyboard 'keyboardDidShow' and 'keyboardDidHide' listers. as tabBarHideOnKeyboard is not working. But wanted to check if tabBarHideOnKeyboard is working or not.

sandesh-wadal commented 6 days ago

@victor-rayan you can use this - I am using this for android only.

useEffect(() => { if (Platform.OS === 'android') { const keyboardDidShowListener = Keyboard.addListener( 'keyboardDidShow', () => { if (bottomBarRef && bottomBarRef.current) { bottomBarRef.current.setVisible(false); } }, ); const keyboardDidHideListener = Keyboard.addListener( 'keyboardDidHide', () => {
if (bottomBarRef && bottomBarRef.current) { bottomBarRef.current.setVisible(true); } }, ); return () => { keyboardDidHideListener.remove(); keyboardDidShowListener.remove(); }; }

}, []);