Socket
Book a DemoInstallSign in
Socket

@secullum/react-native-autofocus

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@secullum/react-native-autofocus

Move to next input field on enter in a form

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
3
Created
Source

react-native-autofocus

npm install @secullum/react-native-autofocus

Autofocus the next input field on enter in React Native.

Have you started with React Native, added a few inputs, and then realized you had to add refs just to focus onto the next input field? This little package solves that problem. Import your text input from and wrap them in a form:

import { Form } from '@secullum/react-native-autofocus'

export default () => (
  <Form focusOn={[MyTextInput]}>
    <MyTextInput placeholder="test" />
    <MyTextInput placeholder="test 2" />
  </Form>
)

Hit enter inside your first input, and the next field will be focused. The logic is all abstracted for you!

Keywords

react-native

FAQs

Package last updated on 19 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts