Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Added captureEvent property
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Auer authored Dec 9, 2019
1 parent 1ced782 commit 80e3ce0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ These options can be used to limit and change the zoom behavior.
| initialOffsetX | number | The horizontal offset the image should start at | 0 |
| initialOffsetY | number | The vertical offset the image should start at | 0 |
| longPressDuration | number | Duration in ms until a press is considered a long press | 700 |
| captureEvent | boolean | Defines whether the pan responder of the parent element should be captured. (useful for react-native modals, set it to true) | false |

#### Events

Expand Down Expand Up @@ -190,10 +191,19 @@ The zoomableViewEventObject object is attached to every event and represents the
distanceTop: number, // view offset from bottom border
lastMovePinch: boolean, // boolean, that states if this movement was a pinch movement
originalHeight: number, // original height of the outer view
originalWidth: numbner, // original width of the outer view
originalWidth: number, // original width of the outer view
captureEvent: boolean, // should the panresponder be taken away from parent component (used for react-native modals)
}
```

## Special configurations

### React Native Modal

To make this work with react-native modals, you have to set the `captureEvent` prop to `true`.
Otherwise the modal will stop the pinch2zoom event and it will not work.


## TODO

* Improve documentation
Expand Down

0 comments on commit 80e3ce0

Please sign in to comment.