All Projects → douglasjunior → React Native Keyboard Manager

douglasjunior / React Native Keyboard Manager

Licence: mit
⚛ Library to prevent issues of keyboard sliding up and cover inputs on React-Native iOS projects.

Projects that are alternatives of or similar to React Native Keyboard Manager

Uiviewcontroller Keyboardadditions
Tiny UIViewController category that provides handy way for keyboard handling logic.
Stars: ✭ 102 (-80.9%)
Mutual labels:  hacktoberfest, keyboard
Awesome Mechanical Keyboard
⌨️ A curated list of Open Source Mechanical Keyboard resources.
Stars: ✭ 1,294 (+142.32%)
Mutual labels:  hacktoberfest, keyboard
Hotkeys
➷ A robust Javascript library for capturing keyboard input. It has no dependencies.
Stars: ✭ 5,165 (+867.23%)
Mutual labels:  keyboard
Mail
💌 Mail app for Nextcloud
Stars: ✭ 528 (-1.12%)
Mutual labels:  hacktoberfest
Nginx
Development repository for the nginx cookbook
Stars: ✭ 528 (-1.12%)
Mutual labels:  hacktoberfest
Upup
✈️ Easily create sites that work offline as well as online
Stars: ✭ 4,777 (+794.57%)
Mutual labels:  hacktoberfest
Trafficcontrol
Apache Traffic Control is an Open Source implementation of a Content Delivery Network
Stars: ✭ 530 (-0.75%)
Mutual labels:  hacktoberfest
Bpmn Js
A BPMN 2.0 rendering toolkit and web modeler.
Stars: ✭ 5,592 (+947.19%)
Mutual labels:  hacktoberfest
Vue Plyr
A Vue component for the plyr (https://github.com/sampotts/plyr) video & audio player.
Stars: ✭ 531 (-0.56%)
Mutual labels:  hacktoberfest
Egua
🦄 Linguagem de programação em português, simples e moderna
Stars: ✭ 528 (-1.12%)
Mutual labels:  hacktoberfest
Vuelayers
Web map Vue components with the power of OpenLayers
Stars: ✭ 532 (-0.37%)
Mutual labels:  hacktoberfest
Es6 Articles
Blog Posts from Wes Bos. If you make an edit to one of these posts, my blog will automatically update.
Stars: ✭ 527 (-1.31%)
Mutual labels:  hacktoberfest
Tenanti
[Package] Multi-tenant Database Schema Manager for Laravel
Stars: ✭ 525 (-1.69%)
Mutual labels:  hacktoberfest
Serverless Dynamodb Local
Serverless Dynamodb Local Plugin - Allows to run dynamodb locally for serverless
Stars: ✭ 530 (-0.75%)
Mutual labels:  hacktoberfest
Hound
Lightning fast code searching made easy
Stars: ✭ 4,955 (+827.9%)
Mutual labels:  hacktoberfest
Burlesco
Leia notícias sem ser assinante, burle o paywall (WebExtension)
Stars: ✭ 528 (-1.12%)
Mutual labels:  hacktoberfest
Bigcache
Efficient cache for gigabytes of data written in Go.
Stars: ✭ 5,304 (+893.26%)
Mutual labels:  hacktoberfest
Gazpacho
🥫 The simple, fast, and modern web scraping library
Stars: ✭ 525 (-1.69%)
Mutual labels:  hacktoberfest
Golem
A Framework for Building Robust Shiny Apps
Stars: ✭ 530 (-0.75%)
Mutual labels:  hacktoberfest
Fabgl
Display Controller (VGA, SSD1306, ST7789, ILI9341), PS/2 Mouse and Keyboard Controller, Graphics Library, Sound Engine, Game Engine and ANSI/VT Terminal for the ESP32
Stars: ✭ 534 (+0%)
Mutual labels:  keyboard

React-Native Keyboard Manager

License MIT npm version npm downloads

Library to prevent issues of keyboard sliding up and cover inputs on React-Native iOS projects ⚛. Thanks to awesome IQKeyboardManager ❤️.

This is only for iOS, Android no needed. For Android just add android:windowSoftInputMode="adjustResize" to your activity.

Screenshots

Enabled Disabled
Credits: IQKeyboardManager

NOTES:

Install

yarn add react-native-keyboard-manager

Or

npm i -S react-native-keyboard-manager

Auto linking

If you are using React Native 0.60.+ go to the folder your-project/ios and run pod install, and you're done.

If not, use one of the following methods to link.

Link with react-native link:

  1. Link the native project

    react-native link react-native-keyboard-manager
    
  2. (Optional) If you want to use Next/Previous buttons, link the IQKeyboardManager resources to your Xcode project.

    1. Open your Xcode project

    2. Got to folder your-project/node_modules/react-native-keyboard-manager/ios/IQKeyboardManager/

    3. Drag and drop the Resources folder to your project root. (If you already have Resources group, drag and drop the IQKeyboardManager.bundle)


    4. In your index.js:

      if (Platform.OS === 'ios') {
          KeyboardManager.setToolbarPreviousNextButtonEnable(true);
      }
      

Link with cocoapods:

  1. Add this line to your Podfile

    pod 'ReactNativeKeyboardManager', :path => '../node_modules/react-native-keyboard-manager'
    
  2. run

    pod install
    

Use

It does not need any library setup to work, just install and go.

But, if you need some configuration, there are some options available. (with default values)

import { Platform } from 'react-native';
import KeyboardManager from 'react-native-keyboard-manager';

if (Platform.OS === 'ios') {
    KeyboardManager.setEnable(true);
    KeyboardManager.setEnableDebugging(false);
    KeyboardManager.setKeyboardDistanceFromTextField(10);
    KeyboardManager.setPreventShowingBottomBlankSpace(true);
    KeyboardManager.setEnableAutoToolbar(true);
    KeyboardManager.setToolbarDoneBarButtonItemText("Done");
    KeyboardManager.setToolbarManageBehaviour(0);
    KeyboardManager.setToolbarPreviousNextButtonEnable(false);
    KeyboardManager.setShouldToolbarUsesTextFieldTintColor(false);
    KeyboardManager.setToolbarTintColor('#0000FF'); // Only #000000 format is supported
    KeyboardManager.setToolbarBarTintColor('#FFFFFF'); // Only #000000 format is supported
    KeyboardManager.setShouldShowTextFieldPlaceholder(true); // deprecated, use setShouldShowToolbarPlaceholder
    KeyboardManager.setShouldShowToolbarPlaceholder(true);
    KeyboardManager.setOverrideKeyboardAppearance(false);
    KeyboardManager.setShouldResignOnTouchOutside(true);
    KeyboardManager.resignFirstResponder();
    KeyboardManager.isKeyboardShowing()
      .then((isShowing) => {
          // ...
      });
}

Enable Next/Previous buttons

If you want to use Next/Previous buttons, enable it.

If you linked using react-native link, make sure you linked the resource file.

if (Platform.OS === 'ios') {
    KeyboardManager.setToolbarPreviousNextButtonEnable(true);
}

And if you want to use Next/Previous buttons inside a Modal, you need to wrap the fields in a PreviousNextView.

class App extends Component {
  render() {
      return (
          <View {...} >
              // others views
              <Modal {...} >
                  // others views
                  <PreviousNextView style={...} >
                      // all TextInput
                  </PreviousNextView>
              </Modal>
          </View>
      );
  }
}

For more details, see the Sample Project and the official IQKeyboardManager documentation.

Contribute

New features, bug fixes and improvements are welcome! For questions and suggestions use the issues.

Become a Patron! Donate

License

The MIT License (MIT)

Copyright (c) 2017 Douglas Nassif Roma Junior

See the full license file.

IQKeyboardManager License

The MIT License (MIT)

Copyright (c) 2013-16 Iftekhar Qurashi

See the full IQKeyboardManager license file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].