Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Import `react-native-keyboard-aware-scroll-view` and wrap your content inside
it:

```js
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
```

```jsx
Expand All @@ -62,11 +62,18 @@ As of `v0.1.0`, the component auto scrolls to the focused `TextInput` 😎. For

In order to scroll to any `TextInput` field, you can use the built-in method `scrollToFocusedInput`. Example:

```js
import { findNodeHandle } from 'react-native';
```

```js
_scrollToInput (reactNode: any) {
// Add a 'scroll' ref to your ScrollView
this.scroll.props.scrollToFocusedInput(reactNode)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outdated too now,
As mentioned here:
#553

}

render() {
...
```

```jsx
Expand All @@ -78,7 +85,7 @@ _scrollToInput (reactNode: any) {
<TextInput
onFocus={(event: Event) => {
// `bind` the function if you're using ES6 classes
this._scrollToInput(ReactNative.findNodeHandle(event.target))
this._scrollToInput(findNodeHandle(event.target))
}}
/>
</View>
Expand Down