Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Latest commit

 

History

History
52 lines (32 loc) · 2.13 KB

File metadata and controls

52 lines (32 loc) · 2.13 KB

react-native-use-input-scroll-handler

This library is deprecated and no longer maintained. Please use one of the actively maintained alternatives below.

Alternatives


Original README (archived)

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

License

MIT