npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-keyboard-behavior

v2.2.0

Published

A react-native module to help you with the keyboard behavior. It is mostly a little upgrade of KeyboardAvoidingView (default mode) with an alternative in some cases of bug (debug mode).

Downloads

5

Readme

A react-native module to help you with the keyboard behavior. It is mostly a little upgrade of KeyboardAvoidingView (default mode) with an alternative in some cases of bug (debug mode).

HOW TO INSTALL

npm i react-native-keyboard-behavior
yarn add react-native-keyboard-behavior

Condition: on Android, you need android:windowSoftInputMode set to "adjustResize" in AndroidManifest.

THE MODES

- "Default": the keyboard will appear on top of the content when showing up and some space is added automatically. The screen will scroll to the focused input if covered up.

- "Debug": the keyboard will appear on top of the content when showing up and some space of the height of the keyboard is added manually. The screen won't scroll to the focused input if covered up.

GUIDELINES

1- Use this component as a container, as the highest View component of your component. NB : You can use it around App only if you won't use the prop disableScrollView (see point 2) or encounter any flickering with the keyboard (see point 4).

2- By default, a ScrollView is added around the children of KeyboardBehavior. So if children is already nested with a ScrollView, you might need to disable the ScrollView of the KeyboardBehavior with the prop disableScrollView.

3- If you are in default mode, you'll need to specify the prop keyboardVerticalOffset. This is the distance between the top of the user screen and the react native view. For example, with react-navigation you should add the header height. If you are not in a safe area, you will also need to add the top inset.

4- On Android, there can be some issues (mostly flickering) when the keyboard appears or disappears, especially if you use react-navigation. If you encounter thoses kind of bugs and if your(s) input(s) are never covered up by the keyboard (e.g are on top of the screen), then you can use the value "debug" to the prop behavior. You won't have any visual bug.

To better understand how the default mode works, you can read about KeyboardAvoidingView. Standard usage:

<KeyboardBehavior keyboardVerticalOffset={headerHeight+insets.top} backgroundColor="black">
  <View>
    <TextInput
    placeholder="test"
    />
  </View>
</KeyboardBehavior>

| Props (all optionals) | Type | Default | | ------------------------------------- | -------------------- | ------------- | | behavior | 'default' or 'debug' | 'default' | | disableScrollView (default mode only) | boolean | false | | backgroundColor | string | 'transparent' | | keyboardVerticalOffset | number | 0 | | width | string or number | "100%" |