File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import createReactClass from 'create-react-class' ;
3+ import PropTypes from 'prop-types' ;
4+ import { FlatList } from 'react-native' ;
5+ import KeyboardAwareMixin from './KeyboardAwareMixin' ;
6+
7+ const KeyboardAwareFlatList = createReactClass ( {
8+ propTypes : {
9+ viewIsInsideTabBar : PropTypes . bool ,
10+ resetScrollToCoords : PropTypes . shape ( {
11+ x : PropTypes . number ,
12+ y : PropTypes . number ,
13+ } ) ,
14+ } ,
15+ mixins : [ KeyboardAwareMixin ] ,
16+
17+ componentWillMount : function ( ) {
18+ this . setViewIsInsideTabBar ( this . props . viewIsInsideTabBar )
19+ this . setResetScrollToCoords ( this . props . resetScrollToCoords )
20+ } ,
21+
22+ render : function ( ) {
23+ return (
24+ < FlatList
25+ ref = '_rnkasv_keyboardView'
26+ keyboardDismissMode = 'interactive'
27+ contentInset = { { bottom : this . state . keyboardSpace } }
28+ showsVerticalScrollIndicator = { true }
29+ scrollEventThrottle = { 0 }
30+ { ...this . props }
31+ onScroll = { e => {
32+ this . handleOnScroll ( e )
33+ this . props . onScroll && this . props . onScroll ( e )
34+ } }
35+ />
36+ )
37+ } ,
38+ } )
39+
40+ export default KeyboardAwareFlatList
You can’t perform that action at this time.
0 commit comments