Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

A react-native hook that handle auto-scroll when input is focused and behind keyboard.

License

Notifications You must be signed in to change notification settings

magrinj/use-input-scroll-handler

Repository files navigation

react-native-use-input-scroll-handler

A react-native hook that handle auto-scroll when input is focused and behind keyboard.

Installation

yarn add react-native-use-input-scroll-handler

Usage

import useInputScrollHandler from "react-native-use-input-scroll-handler";

// ...

const { scrollHandler } = useInputScrollHandler();

<ScrollView {...scrollHandler}>

API

Custom options can be passed to this hook.

Option Type Description
ref MutableRefObject Use this if you need to use your own scroll view ref.
extraScrollHeight number Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard.
keyboardOpeningTime number Sets the delay time before scrolling to new position, default is 250

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

About

A react-native hook that handle auto-scroll when input is focused and behind keyboard.

Resources

License

Stars

Watchers

Forks

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.