File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * @Author : 石破天惊
3
+ * @email : shanshang130@gmail.com
4
+ * @Date : 2021-07-21 13:05:32
5
+ * @LastEditTime : 2021-09-18 10:39:36
6
+ * @LastEditors : 石破天惊
7
+ * @Description :
8
+ */
1
9
/*
2
10
*
3
11
* Created by Stone
@@ -13,7 +21,7 @@ import {SpringScrollView} from '../src';
13
21
14
22
export class BouncesAndScrollEnabledExample extends React . Component {
15
23
state = {
16
- contentCount : 20 ,
24
+ contentCount : 100 ,
17
25
bounces : true ,
18
26
scrollEnabled : true ,
19
27
showsVerticalScrollIndicator : true ,
@@ -33,7 +41,7 @@ export class BouncesAndScrollEnabledExample extends React.Component {
33
41
key = { index }
34
42
onPress = { ( ) => {
35
43
this . setState ( ( p ) => ( {
36
- contentCount : p . contentCount === 1 ? 20 : 1 ,
44
+ contentCount : p . contentCount === 1 ? 100 : 1 ,
37
45
} ) ) ;
38
46
} } >
39
47
< Text style = { styles . text } >
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export class SpringScrollView extends React.PureComponent<SpringScrollViewPropTy
50
50
_scrollEventAttachment ;
51
51
_nativeOffset ;
52
52
_touching = false ;
53
+ _dragging = false ;
53
54
_sizeChangeInterval = 0 ;
54
55
55
56
constructor ( props ) {
@@ -95,6 +96,7 @@ export class SpringScrollView extends React.PureComponent<SpringScrollViewPropTy
95
96
onScrollBeginDrag = { this . _onScrollBeginDrag }
96
97
onMomentumScrollEnd = { this . _onMomentumScrollEnd }
97
98
scrollEventThrottle = { 1 }
99
+ onStartShouldSetResponderCapture = { ( ) => this . _dragging }
98
100
>
99
101
< SpringScrollContentViewNative
100
102
style = { contentStyle }
@@ -557,11 +559,13 @@ export class SpringScrollView extends React.PureComponent<SpringScrollViewPropTy
557
559
558
560
_onMomentumScrollEnd = ( ) => {
559
561
this . _touching = false ;
562
+ this . _dragging = false ;
560
563
this . _beginIndicatorDismissAnimation ( ) ;
561
564
this . props . onMomentumScrollEnd && this . props . onMomentumScrollEnd ( ) ;
562
565
} ;
563
566
564
567
_onScrollBeginDrag = ( ) => {
568
+ this . _dragging = true ;
565
569
if ( this . props . dragToHideKeyboard ) Keyboard . dismiss ( ) ;
566
570
this . props . onScrollBeginDrag && this . props . onScrollBeginDrag ( ) ;
567
571
} ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-spring-scrollview" ,
3
- "version" : " 3.0.1-rc.5 " ,
3
+ "version" : " 3.0.2 " ,
4
4
"description" : " A cross-platform (iOS & Android) spring ScrollView" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments