Skip to content

Commit

Permalink
Re-fix scroll / pan / move bug
Browse files Browse the repository at this point in the history
Super hard to get scroll / pan + move working 100% but this is pretty close. Downside is that scroll is disabled on ScrollView.

This discussion may help: facebook/react-native#1046
  • Loading branch information
m4nuC committed Sep 24, 2017
1 parent 6470237 commit 784f2df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export default class App extends React.Component {
const { image } = this.state;
return (
<View style={styles.container}>
<ScrollView scrollEnabled={false} maximumZoomScale={4} style={styles.pinchableView}>
<ScrollView scrollEnabled={false}
maximumZoomScale={4}
style={styles.pinchableView}
>
{ image &&
<View style={styles.imageContainer}>
<Image style={styles.image} source={{uri: image.uri}} />
Expand Down
6 changes: 3 additions & 3 deletions TearDropStage/TearDropStage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export default class TearDropStage extends React.Component {
}

_panResponder = genPanHandlers({
// onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
// onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
onPanResponderMove: (evt, gestureState) => {
const { activeTeardropID } = this.state;
if (activeTeardropID) {
const { moveX, moveY } = gestureState;
const { moveX, moveY, numberActiveTouches } = gestureState;
if (activeTeardropID && numberActiveTouches === 1) {
this.props.moveTeardrop({
id: activeTeardropID,
cx: moveX,
Expand Down

0 comments on commit 784f2df

Please sign in to comment.