Skip to content

Commit 97163b8

Browse files
joshuapintergitim
authored andcommitted
Allow scrolling unless long press on Android.
Fixes one fo the big ToDos in #15.
1 parent e5cf86e commit 97163b8

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/Row.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,21 @@ export default class Row extends Component {
4040
}
4141

4242
_panResponder = PanResponder.create({
43-
onStartShouldSetPanResponder: () => !this._isDisabled(),
44-
onMoveShouldSetPanResponder: () => !this._isDisabled(),
43+
onStartShouldSetPanResponder: () => {
44+
if (this._isDisabled()) return false;
45+
46+
return true;
47+
},
48+
49+
onMoveShouldSetPanResponder: () => {
50+
if (this._isDisabled()) return false;
51+
52+
return true;
53+
},
54+
55+
onShouldBlockNativeResponder: () => { // Returns whether this component should block native components from becoming the JS
56+
return false; // responder. Returns true by default. Is currently only supported on android.
57+
}, // NOTE: Returning false here allows us to scroll unless it's a long press on a row.
4558

4659
onPanResponderGrant: (e, gestureState) => {
4760
e.persist();

0 commit comments

Comments
 (0)