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

Bottom tab bar is not hiding under keyboard / only taking the props of tabBarActiveBackgroundColor #45

Open
ridasajjad5 opened this issue Feb 23, 2022 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@ridasajjad5
Copy link

i installed the library it is working fine but tab bar is not hiding under keyboard modal . i set the "tabBarHideOnKeyboard: true" in the screenOption. kindly let me the if there is any work around or solution whatever it is Thanks

@Jm-Zion
Copy link
Owner

Jm-Zion commented Feb 23, 2022

Hi,
Thank you for the feedback,
I see the problem, I don't have a workaround right now, i'll give it a check by tomorrow morning :)

@Jm-Zion
Copy link
Owner

Jm-Zion commented Feb 24, 2022

Hi,
I think i've to do something for this case, at the moment you could wrap the tabBar component with a component that handle this.

Something like :


const HideOnKeyboard: React.FC = (props) => {
  const [hidden, setHidden] = React.useState(false);

  React.useEffect(() => {
    const keyboardDidShowListener = Keyboard.addListener(
      'keyboardDidShow',
      keyboardDidShow,
    );
    const keyboardDidHideListener = Keyboard.addListener(
      'keyboardDidHide',
      keyboardDidHide,
    );
    return () => {
      keyboardDidShowListener.remove();
      keyboardDidHideListener.remove();
    };
  });

  const keyboardDidShow = () => {
    setHidden(true);
  };

  const keyboardDidHide = () => {
    setHidden(false);
  };

  return !hidden && props.children;
};

@Jm-Zion Jm-Zion added the bug Something isn't working label Mar 20, 2022
@Jm-Zion Jm-Zion added documentation Improvements or additions to documentation and removed bug Something isn't working labels Jun 15, 2023
@commencementtech
Copy link

Above solution creating issue that it's showing all menu active for some times and then after it showing correct menu

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

No branches or pull requests

3 participants