Gathering detailed insights and metrics for @kazzkiq/react-native-input-scroll-view
Gathering detailed insights and metrics for @kazzkiq/react-native-input-scroll-view
Gathering detailed insights and metrics for @kazzkiq/react-native-input-scroll-view
Gathering detailed insights and metrics for @kazzkiq/react-native-input-scroll-view
Perfect TextInput ScrollView
npm install @kazzkiq/react-native-input-scroll-view
Typescript
Module System
Node Version
NPM Version
JavaScript (60.09%)
Java (20.65%)
Objective-C (14.71%)
Ruby (2.55%)
Starlark (2%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
350 Stars
130 Commits
75 Forks
9 Watchers
1 Branches
10 Contributors
Updated on Jan 17, 2025
Latest Version
1.10.1
Package Id
@kazzkiq/react-native-input-scroll-view@1.10.1
Unpacked Size
22.14 kB
Size
7.01 kB
File Count
5
NPM Version
6.14.2
Node Version
10.16.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Mainly to achieve the following functions:
TextInput
will automatically adjust to the top of the keyboard.ScrollView
will not be obscured by the keyboard.TextInput
gets focus, the selected cursor will be automatically adjusted to the top of the keyboard.TextInput
create new line, the new line will automatically adjust to the top of the keyboard.TextInput
and slide ScrollView
, when you lift your finger, the TextInput
will not get focus.
npm
1$ npm install react-native-input-scroll-view --save
yarn
1$ yarn add react-native-input-scroll-view
1import InputScrollView from 'react-native-input-scroll-view'; 2... 3state = { 4 text: '', 5}; 6 7render() { 8 const { text } = this.state; 9 return ( 10 <InputScrollView> 11 <TextInput /> 12 <TextInput /> 13 <TextInput value={text} 14 onChangeText={text => this.setState({ text })} 15 multiline /> 16 </InputScrollView> 17 ); 18}
React-native-input-scroll-view automatically modify onContentSizeChange, onSelectionChange, and onChange TextInput
props. It is not yet designed to pass them down if the TextInput
is wrapped into another component so don’t forget to do it:
1import InputScrollView from 'react-native-input-scroll-view'; 2... 3 4const MyComponent = props => ( 5 <View> 6 <TextInput {...props} /> 7 </View> 8); 9... 10 11state = { 12 text: '', 13}; 14 15render() { 16 const { text } = this.state; 17 return ( 18 <InputScrollView> 19 <MyComponent value={text} 20 onChangeText={text => this.setState({ text })} 21 /> 22 </InputScrollView> 23 ); 24}
Note that if the cursor is to be correctly adjusted to the top of the keyboard, you must bind value
to TextInput
.
If your ReactNative version is on or above v0.57
, skip this section.
Before a certain version of ReactNative, multiline TextInput
height on an Android device could not change properly based on its content, so we need to add additional processing code
1import InputScrollView from 'react-native-input-scroll-view'; 2... 3 4state = { 5 text: '', 6 textareaHeight: null, 7}; 8 9render() { 10 const { text, textareaHeight } = this.state; 11 return ( 12 <InputScrollView> 13 <TextInput /> 14 <TextInput /> 15 <TextInput style={{ height: textareaHeight }} 16 value={text} 17 onChangeText={text => this.setState({ text })} 18 onContentSizeChange={this._onContentSizeChange} 19 multiline /> 20 </InputScrollView> 21 ); 22} 23 24_onContentSizeChange = ({nativeEvent:event}) => { 25 this.setState({ textareaHeight: event.contentSize.height }); 26};
Property | Type | Default | Description |
---|---|---|---|
topOffset | number | undefined | The offset of the InputScrollView relative to the top of the window. When the screen contains TopBar , it is usually set to the height of TopBar . If not explicitly set, the program will automatically determine, but may cause problems. issues#43。 |
keyboardOffset | number | 40 | When automatic adjustment, the cursor relative to the top of the keyboard offset. |
multilineInputStyle | Style | null | If your multiline TextInput has a specific style, to ensure that the cursor can be accurately adjusted to the top of the keyboard, this is set as a multiline TextInput style, The style attributes that mainly include fontSize 、fontFamily 、lineHeight etc. affect the position of the cursor. Be careful not to include width and height . |
useAnimatedScrollView | bool | false | Replace regular ScrollView component with Animated.ScrollView component. |
supportHardwareKeyboard | bool | false | beta If your device does not use a soft keyboard, try using this parameter to solve the problem. issues#69 |
keyboardAvoidingViewProps | props | null | KeyboardAvoidingView component Props. Check them here: https://facebook.github.io/react-native/docs/keyboardavoidingview |
...ScrollView.props | props | All props from ScrollView are inherited. Check them here: https://facebook.github.io/react-native/docs/scrollview.html |
"react": "^16.0.0-alpha.12"
"react-native": ">=0.46.0"
MIT
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 5/25 approved changesets -- score normalized to 2
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
52 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More